mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Bug #32307 mysqltest - does not detect illegal if syntax
This commit is contained in:
@ -41,12 +41,19 @@ while ($i)
|
||||
error 0,1436 //
|
||||
eval $query_head 0 $query_tail//
|
||||
|
||||
if ($mysql_errno != 1436)
|
||||
if ($mysql_errno)
|
||||
{
|
||||
# We reached the place where we reported an error about the stack limit,
|
||||
# and we successfully returned the error. That means that at the stack
|
||||
# limit, we still have enough space reserved to report an error.
|
||||
let $i = 1//
|
||||
|
||||
# Check that mysql_errno is 1436
|
||||
if (`select $mysql_errno != 1436`)
|
||||
{
|
||||
die Wrong error triggered, expected 1436 but got $mysql_errno//
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# Multiplying by three stack frames should be fine enough resolution.
|
||||
|
@ -2131,5 +2131,25 @@ rmdir $MYSQLTEST_VARDIR/tmp/testdir;
|
||||
--replace_result c:\\a.txt z
|
||||
SELECT 'c:\\a.txt' AS col;
|
||||
|
||||
#
|
||||
# Bug #32307 mysqltest - does not detect illegal if syntax
|
||||
#
|
||||
|
||||
let $test= 1;
|
||||
if ($test){
|
||||
echo hej;
|
||||
}
|
||||
|
||||
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
|
||||
if ($mysql_errno != 1436)
|
||||
{
|
||||
echo ^ Should not be allowed!
|
||||
}
|
||||
EOF
|
||||
--error 1
|
||||
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
|
||||
|
||||
|
||||
--echo End of tests
|
||||
|
||||
|
@ -1665,7 +1665,7 @@ DROP PROCEDURE IF EXISTS p1;
|
||||
let $iterations= 100;
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
while ($iterations > 0)
|
||||
while ($iterations)
|
||||
{
|
||||
--error ER_PARSE_ERROR
|
||||
PREPARE stmt FROM "CREATE PROCEDURE p1()";
|
||||
|
Reference in New Issue
Block a user