mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
1d6addd9bb
Use open_normal_and_derived_tables instead of open_and_lock_tables when reading metadata for a table. Add two test cases, one for "USE database" and one for "SHOW COLUMNS FROM table" mysql-test/r/lock_multi.result: Updated test results for test case for bug9998 mysql-test/r/mysql.result: Updated results for test case for bug9998 mysql-test/t/lock_multi.test: Test that "show columsn from t1" is not locked by another thread having a write lock on t1 mysql-test/t/mysql.test: Add test case for BUG9998 - lock table t1 for write from mysql-test, then execute 'mysql' and call "USE test". This will test exactly what caused the bug. sql/sql_show.cc: Open tables without locking when reading metadata
43 lines
1.1 KiB
Text
43 lines
1.1 KiB
Text
#
|
|
# Testing the MySQL command line client(mysql)
|
|
#
|
|
|
|
--disable_warnings
|
|
drop table if exists t1;
|
|
--enable_warnings
|
|
|
|
#
|
|
# Test the "delimiter" functionality
|
|
# Bug#9879
|
|
#
|
|
create table t1(a int);
|
|
insert into t1 values(1);
|
|
|
|
# Test delimiters
|
|
--exec $MYSQL test < "./t/mysql_delimiter.sql"
|
|
|
|
--disable_query_log
|
|
# Test delimiter : supplied on the command line
|
|
select "Test delimiter : from command line" as " ";
|
|
--exec $MYSQL test --delimiter=':' -e 'select * from t1:'
|
|
# Test delimiter :; supplied on the command line
|
|
select "Test delimiter :; from command line" as " ";
|
|
--exec $MYSQL test --delimiter=':;' -e 'select * from t1:;'
|
|
# Test 'go' command (vertical output) \G
|
|
select "Test 'go' command(vertical output) \G" as " ";
|
|
--exec $MYSQL test -e 'select * from t1\G'
|
|
# Test 'go' command \g
|
|
select "Test 'go' command \g" as " ";
|
|
--exec $MYSQL test -e 'select * from t1\g'
|
|
--enable_query_log
|
|
drop table t1;
|
|
|
|
#
|
|
# BUG9998 - MySQL client hangs on USE "database"
|
|
#
|
|
create table t1(a int);
|
|
lock tables t1 write;
|
|
--exec $MYSQL -e 'use test; select database();'
|
|
unlock tables;
|
|
drop table t1;
|
|
|