Skip to content

Commit 9a57d2a

Browse files
committed
Update PositionCalculator.php
For this SQL : insert into logs(`id`,`ip`,`status`,`dt`) values ('1','192.168.1.100','1','2016-05-17 14:25:52') , it throw a UnableToCalculatePositionException IN positions/PositionCalculator.php Line 224 . But this SQL can be executed in mysql server. I suggest this type of sql can be calulate as operator OR any other solution.TKS 4 U help .
1 parent 8d11ec6 commit 9a57d2a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/PHPSQLParser/positions/PositionCalculator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ protected function findPositionWithinString($sql, $value, $expr_type) {
154154
// whitespace, comma, parenthesis, digit or letter, end_of_string
155155
// an operator should not be surrounded by another operator
156156

157-
if ($expr_type === 'operator') {
157+
if (in_array($expr_type,array('operator','column-list'),true)) {
158158

159159
$ok = ($before === "" || in_array($before, self::$allowedOnOperator, true))
160160
|| (strtolower($before) >= 'a' && strtolower($before) <= 'z');

0 commit comments

Comments
 (0)