mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Bug#33851 Passing UNSIGNED param to EXECUTE returns ERROR 1210
The problem is that passing anything other than a integer to a limit clause in a prepared statement would fail. This limitation was introduced to avoid replication problems (e.g: replicating the statement with a string argument would cause a parse failure in the slave). The solution is to convert arguments to the limit clause to a integer value and use this converted value when persisting the query to the log.
This commit is contained in:
@@ -290,6 +290,22 @@ select * from t1;
|
||||
a b
|
||||
2 1
|
||||
drop table t1;
|
||||
create table t1(a int);
|
||||
insert into t1 values (1),(2);
|
||||
prepare s1 from 'insert into t1 select a from t1 limit ?';
|
||||
set @x='1.1';
|
||||
execute s1 using @x;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
1
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
1
|
||||
drop table t1;
|
||||
End of 5.0 tests.
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
DROP FUNCTION IF EXISTS f2;
|
||||
|
Reference in New Issue
Block a user