Skip to content

Conversation

@sinri
Copy link
Contributor

@sinri sinri commented Jan 16, 2019

Made a fix.

Fixes: #223

Copy link
Member

@williamdes williamdes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thank you @sinri !
Can a regression test be added ?

@sinri
Copy link
Contributor Author

sinri commented Jan 17, 2019

LGTM
Thank you @sinri !
Can a regression test be added ?

Can you provide me any instructions about the regression test? So I could try to add then.

@sinri
Copy link
Contributor Author

sinri commented Jan 17, 2019

Tried PHPUnit,

There was 1 failure:

1) PhpMyAdmin\SqlParser\Tests\Parser\CallStatementTest::testCall with data set #2 ('parser/parseCall3')
Failed asserting that two objects are equal.
--- Expected
+++ Actual
@@ @@
             'call' => PhpMyAdmin\SqlParser\Components\FunctionCall Object (...)
             'options' => null
             'first' => 0
-            'last' => 3
+            'last' => 2
         )
     )
     'brackets' => 0

/Users/sinri/code/phpstorm/sql-parser/tests/TestCase.php:107
/Users/sinri/code/phpstorm/sql-parser/tests/Parser/CallStatementTest.php:16

The test case IN file contains CALL foo;.

After checking, I think here last should be updated to 2.
It might need some discuss.


BTW, the operator instanceof may throw a lot of Error: Class name must be a valid object or a string, need confirming that this had been there with the existed codes...

@devenbansod devenbansod self-requested a review January 20, 2019 15:30
@stale
Copy link

stale bot commented Mar 21, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 21, 2019
@ibennetch
Copy link
Member

This looks good to me, thank you for your contribution!


$this->after($parser, $list, $token);

// #223 Here may make a patch, if last is delimiter, back one
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to find a way to say this a bit differently since I'm a little not clear about what the "one" is here. Would this phrasing work for you?

// Issue 223: If the previous token is a delimiter, go back to the previous token

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this line is missing a $class !== null check beforehand, as we use it a few lines above.

I tried to PR a suggestion, but it seems this lines are not contained in the master branch?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@staabm This should be part of master now, can you make sure you're pulling the latest change from this repository?

@ibennetch ibennetch merged commit f3bee14 into phpmyadmin:master May 6, 2019
ibennetch added a commit that referenced this pull request May 6, 2019
ibennetch added a commit that referenced this pull request May 6, 2019
@ibennetch
Copy link
Member

This breaks quite a few things in tests, there are 11 errors relating to

Error: Class name must be a valid object or a string

that weren't there before merging this pull request.

If you can fix the test failures, I can merge that fix, otherwise I may have to roll back this change. I should have noticed the errors before merging but was focused on the test failure in parseCall3 instead.

@staabm staabm mentioned this pull request May 7, 2019
ibennetch added a commit that referenced this pull request May 9, 2019
Added null check to fix tests from pull request #224.
@williamdes williamdes self-assigned this Apr 21, 2023
@williamdes williamdes removed the request for review from devenbansod April 21, 2023 19:11
@williamdes
Copy link
Member

williamdes commented Apr 21, 2023

Hi @sinri
I am re-working this PR to fix #372

After checking, I think here last should be updated to 2.
It might need some discuss.

I am not really sure you where so certain about that, do you remember ?
Edit: nevermind, I found out that your fix could be done some other way. And found why you did it
See: #442

williamdes added a commit that referenced this pull request Apr 21, 2023
Pull-request: #224

Signed-off-by: William Desportes <[email protected]>
@williamdes williamdes added this to the 5.0.0 milestone Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issues with Call Statement

4 participants