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

More than one prepared statement in a transaction fails in PHP PDO #1187

Open
readyset-railway opened this issue Mar 29, 2024 · 0 comments
Open
Assignees

Comments

@readyset-railway
Copy link
Contributor

Summary

PHP framework tests are failing in the migration stage. This is happening because ReadySet fails when there are more than one prepared statement in a transaction.

Steps to reproduce

$pdo = new PDO("pgsql:host=127.0.0.1;dbname=framework_test;port=5433", 'sandaru1', 'readyset');

$pdo->query("DROP TABLE IF EXISTS users");
$pdo->query("create table \"users\" (\"id\" bigserial not null primary key, \"name\" varchar(255) not null, \"email\" varchar(255) not null, \"email_verified_at\" timestamp(0) without time zone null, \"password\" varchar(255) not null, \"remember_token\" varchar(100) null, \"created_at\" timestamp(0) without time zone null, \"updated_at\" timestamp(0) without time zone null)");

$pdo->exec("BEGIN");
$pdo->query("SELECT * FROM users;");
$pdo->query("SELECT id FROM users;");
$pdo->exec("COMMIT");

ReadySet version

954e715a3c9aad83c15d17cd568a88d64448d8c5

Upstream DB type and version

Postgres 16

Logs

Fatal error: Uncaught PDOException: SQLSTATE[25P02]: In failed sql transaction: 7 ERROR:  current transaction is aborted, commands ignored until end of transaction block in /Users/sandaru1/readyset/orm-migration-test/laravel.php:16
Stack trace:
#0 /Users/sandaru1/readyset/orm-migration-test/laravel.php(16): PDO->query('SELECT id FROM ...')
#1 {main}
  thrown in /Users/sandaru1/readyset/orm-migration-test/laravel.php on line 16
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

No branches or pull requests

2 participants