mirror of
https://github.com/MariaDB/server.git
synced 2025-09-06 19:08:06 +03:00

The server sends a number of columns to the client. It uses a limited "fast" function for that instead of the general one. This fast function cannot send numbers larger than 2 bytes. This causes the client to expect smaller number of columns. The client writes outside of the allocated memory buffer as a result. Fixed the server to use the general function to send column count. Fixed the client to check the column count before writing column data.
54 lines
2.0 KiB
Plaintext
54 lines
2.0 KiB
Plaintext
# This test should work in embedded server after we fix mysqltest
|
|
-- source include/not_embedded.inc
|
|
|
|
#
|
|
# Bug #20432: mysql client interprets commands in comments
|
|
#
|
|
|
|
# if the client sees the 'use' within the comment, we haven't fixed
|
|
--exec echo "/*" > $MYSQLTEST_VARDIR/tmp/bug20432.sql
|
|
--exec echo "use" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
|
|
--exec echo "*/" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
|
|
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1
|
|
|
|
# SQL can have embedded comments => workie
|
|
--exec echo "select /*" > $MYSQLTEST_VARDIR/tmp/bug20432.sql
|
|
--exec echo "use" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
|
|
--exec echo "*/ 1" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
|
|
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1
|
|
|
|
# client commands on the other hand must be at BOL => error
|
|
--exec echo "/*" > $MYSQLTEST_VARDIR/tmp/bug20432.sql
|
|
--exec echo "xxx" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
|
|
--exec echo "*/ use" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
|
|
--error 1
|
|
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1
|
|
|
|
# client comment recognized, but parameter missing => error
|
|
--exec echo "use" > $MYSQLTEST_VARDIR/tmp/bug20432.sql
|
|
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1
|
|
|
|
#
|
|
# Bug #20328: mysql client: dumb about trailing spaces on 'help' command
|
|
#
|
|
--exec echo 'help' | $MYSQL > $MYSQLTEST_VARDIR/tmp/bug20328.tmp
|
|
--exec echo 'help ' | $MYSQL > $MYSQLTEST_VARDIR/tmp/bug20328.tmp
|
|
|
|
#
|
|
# Bug #19216: Client crashes on long SELECT
|
|
#
|
|
--exec echo "select" > $MYSQLTEST_VARDIR/tmp/b19216.tmp
|
|
# 3400 * 20 makes 68000 columns that is more than the max number that can fit
|
|
# in a 16 bit number.
|
|
let $i= 3400;
|
|
while ($i)
|
|
{
|
|
--exec echo "'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a'," >> $MYSQLTEST_VARDIR/tmp/b19216.tmp
|
|
dec $i;
|
|
}
|
|
|
|
--exec echo "'b';" >> $MYSQLTEST_VARDIR/tmp/b19216.tmp
|
|
--disable_query_log
|
|
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/b19216.tmp >/dev/null
|
|
--enable_query_log
|