Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL dump silently fails if query is not terminated by semicolon #4059

Closed
igorsantos07 opened this issue Mar 14, 2017 · 0 comments
Closed

SQL dump silently fails if query is not terminated by semicolon #4059

igorsantos07 opened this issue Mar 14, 2017 · 0 comments

Comments

@igorsantos07
Copy link
Contributor

@igorsantos07 igorsantos07 commented Mar 14, 2017

What are you trying to achieve?

Importing a dump that includes a single INSERT statement, not terminated by semicolon - it's expected to run just fine on PDO; in the end, it's a single command.

What do you get instead?

Nothing. Pure wind.

Investigation

Investigating the issue, it seems related to a silent test done by Driver\Db, which basically doesn't run queries not terminated by the given delimiter.

To me, this feels like a not needed protection that might have bad, silent side effects - like it happened to me. So I would expect one of those:

  1. some reason on why this is needed since the underlying driver (PDO) is completely capable of running SQL queries without a delimiter in the very end. I noticed this is cited as needed in the Db Module doc, but without reasoning.
  2. that guard to be taken out, so queries can run freely without a delimiter :)

Details

  • Codeception version: ^2.2 (dev-master, c8df4d7)
  • PHP Version: 7.0.x
  • Operating System: Ubuntu
  • Installation type: Composer
Naktibalda added a commit to Naktibalda/Codeception that referenced this issue Mar 22, 2017
DavertMik added a commit that referenced this issue Mar 24, 2017
* [Db] Run the last statement in file even if it doesn't end with delimiter

Fixes #4059

* Eliminated property sqltoRun
chris1312 pushed a commit to chris1312/Codeception that referenced this issue Jun 16, 2017
* [Db] Run the last statement in file even if it doesn't end with delimiter

Fixes Codeception#4059

* Eliminated property sqltoRun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.