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

Update DeleteReset.php #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

qschmick
Copy link

@qschmick qschmick commented May 5, 2020

Fixes issue:

PHPUnit\DbUnit\Operation\Exception: COMPOSITE[DELETE - RESET] operation failed on query: DELETE FROM `table`; ALTER TABLE `table` AUTO_INCREMENT=1; using args: Array
 [SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE `table` AUTO_INCREMENT=1' at line 1]

Fixes issue:
```
PHPUnit\DbUnit\Operation\Exception: COMPOSITE[DELETE - RESET] operation failed on query: DELETE FROM `table`; ALTER TABLE `table` AUTO_INCREMENT=1; using args: Array
 [SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE `table` AUTO_INCREMENT=1' at line 1]
```
@kornrunner
Copy link
Owner

Could you please check if bec3562 sorts the issue for you? Thanks!

@qschmick
Copy link
Author

qschmick commented May 6, 2020

@kornrunner That does not fix the issue, still get the same error.

@kornrunner
Copy link
Owner

Weird, as all current tests are passing. Which PDO driver are you using?

@lotsofbytes
Copy link

I had the same issue with mysql. Adding this option to mysql connection solved it.

PDO::ATTR_EMULATE_PREPARES => 1,

       'mysql' => [
            'driver' => 'mysql',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            'strict' => false,
            'engine' => null,
            'options' => extension_loaded('pdo_mysql') ? array_filter([
                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
                PDO::ATTR_EMULATE_PREPARES => 1,
            ]) : [],
        ],

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.

3 participants