Prepared statements failing (mysql/MariaDB, sqlpad > 4.3)
See original GitHub issueRunning sqlpad 4.4 and latest (from docker hub; MariaDB container pinned to 10.5.3) i can’t use prepare/execute statements. Even simple examples based on https://mariadb.com/kb/en/prepare-statement/#example fail:
PREPARE stmt FROM 'SELECT @x;';
SET @x = 1;
EXECUTE stmt;
–>
ER_UNKNOWN_STMT_HANDLER: Unknown prepared statement handler (stmt) given to EXECUTE
SET @table = "some_table";
SET @sql = CONCAT('SELECT * FROM ', @table);
PREPARE stmt FROM @sql;
EXECUTE stmt;
–>
ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NULL' at line 1
Both examples work with sqlpad 4.3 (from docker hub) and using MariaDBs console.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
PREPARE Statement - MariaDB Knowledge Base
If the prepared statement contains a syntax error, PREPARE will fail. As a side effect, stored procedures can use it to check if...
Read more >Problems with prepared statements for a select query
Here's how I would code it: function password_matches($mysqli, $user, $pass) { $stmt = $mysqli->prepare("SELECT pswHash FROM user_list WHERE ...
Read more >Repreparation of prepared statements in MySQL/MariaDB ...
An error occurs if all attempts fail. Metadata changes occur for DDL statements such as those that create, drop, alter, rename, or truncate ......
Read more >Prepared-Statement fails when MySQL-Server under load
Description: Hello As backup-procedure we use 4 concurrent mysql-dump processes. When these processes are running, ...
Read more >injection - CVE - Search Results
This issue has been patched in version 1.7.0 by using Javas PreparedStatements, which allow object setting without the risk of SQL injection.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yeah it is all related.
Once the updated implementation lands it’ll allow for transactions across query executions. The underlying database connection will be held open and kept alive while browser tab is open. If user opts into it that is. Otherwise if falls back to 1 query run = one connection. (or today in the event your query has many statements, it could be many connections)
Fix for this will be in
latestdocker image. Limits are enforced bysql-limiternow so there could potentially be some quirks introduced with that… hopefully not though.