diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/metadata.result | 41 | ||||
-rw-r--r-- | mysql-test/r/mysqlbinlog.result | 6 | ||||
-rw-r--r-- | mysql-test/r/rpl_change_master.result | 70 | ||||
-rw-r--r-- | mysql-test/t/metadata.test | 21 | ||||
-rw-r--r-- | mysql-test/t/mysqlbinlog.test | 13 | ||||
-rw-r--r-- | mysql-test/t/rpl_change_master.test | 4 |
6 files changed, 149 insertions, 6 deletions
diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result index d33fb038b79..4a776b6a253 100644 --- a/mysql-test/r/metadata.result +++ b/mysql-test/r/metadata.result @@ -140,4 +140,45 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is def a v_small v_small 3 9 9 N 32769 0 63 v_small 214748364 +CREATE TABLE t1 (c1 CHAR(1)); +CREATE TABLE t2 (c2 CHAR(1)); +CREATE VIEW v1 AS SELECT t1.c1 FROM t1; +CREATE VIEW v2 AS SELECT t2.c2 FROM t2; +INSERT INTO t1 VALUES ('1'), ('2'), ('3'); +INSERT INTO t2 VALUES ('1'), ('2'), ('3'), ('2'); +SELECT v1.c1 FROM v1 JOIN t2 ON c1=c2 ORDER BY 1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 v1 c1 c1 254 1 1 Y 0 0 8 +c1 +1 +2 +2 +3 +SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 v1 c1 c1 254 1 1 Y 0 0 8 +def test t2 v2 c2 c2 254 1 1 Y 0 0 8 +c1 c2 +1 1 +2 2 +3 3 +2 2 +SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 v1 c1 c1 254 1 1 Y 32768 0 8 +def test t2 v2 c2 c2 254 1 1 Y 0 0 8 +c1 c2 +1 1 +2 2 +3 3 +SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1 ORDER BY v2.c2; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 v1 c1 c1 254 1 1 Y 32768 0 8 +def test t2 v2 c2 c2 254 1 1 Y 0 0 8 +c1 c2 +1 1 +2 2 +3 3 +DROP VIEW v1,v2; +DROP TABLE t1,t2; End of 5.0 tests diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index a50d131cca8..1ba198dfd75 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -312,4 +312,10 @@ DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +CREATE TABLE t1 (c1 CHAR(10)); +flush logs; +INSERT INTO t1 VALUES ('0123456789'); +flush logs; +DROP TABLE t1; +# Query thread_id=REMOVED exec_time=REMOVED error_code=REMOVED End of 5.0 tests diff --git a/mysql-test/r/rpl_change_master.result b/mysql-test/r/rpl_change_master.result index 7f2ba568fb3..98c42069470 100644 --- a/mysql-test/r/rpl_change_master.result +++ b/mysql-test/r/rpl_change_master.result @@ -12,12 +12,74 @@ insert into t1 values(1); insert into t1 values(2); stop slave; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 357 # # master-bin.000001 No No 0 0 183 # None 0 No # +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port MASTER_MYPORT +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos 357 +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running No +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos 183 +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # change master to master_user='root'; show slave status; -Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master -# 127.0.0.1 root MASTER_MYPORT 1 master-bin.000001 183 # # master-bin.000001 No No 0 0 183 # None 0 No # +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port MASTER_MYPORT +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos 183 +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running No +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos 183 +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # start slave; select * from t1; n diff --git a/mysql-test/t/metadata.test b/mysql-test/t/metadata.test index df4acec2021..65c062399b7 100644 --- a/mysql-test/t/metadata.test +++ b/mysql-test/t/metadata.test @@ -90,5 +90,26 @@ select a.* from (select 2147483648 as v_large) a; select a.* from (select 214748364 as v_small) a; --disable_metadata +# +# Bug #28898: table alias and database name of VIEW columns is empty in the +# metadata of # SELECT statement where join is executed via temporary table. +# + +CREATE TABLE t1 (c1 CHAR(1)); +CREATE TABLE t2 (c2 CHAR(1)); +CREATE VIEW v1 AS SELECT t1.c1 FROM t1; +CREATE VIEW v2 AS SELECT t2.c2 FROM t2; +INSERT INTO t1 VALUES ('1'), ('2'), ('3'); +INSERT INTO t2 VALUES ('1'), ('2'), ('3'), ('2'); + +--enable_metadata +SELECT v1.c1 FROM v1 JOIN t2 ON c1=c2 ORDER BY 1; +SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2; +SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1; +SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2 GROUP BY v1.c1 ORDER BY v2.c2; +--disable_metadata + +DROP VIEW v1,v2; +DROP TABLE t1,t2; --echo End of 5.0 tests diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index ba161ddbb89..bd90dcfb930 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -203,4 +203,17 @@ flush logs; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000009 +# +# Bug#28293 missed '#' sign in the hex dump when the dump length +# is divisible by 16. +# + +CREATE TABLE t1 (c1 CHAR(10)); +# we need this for getting fixed timestamps inside of this test +flush logs; +INSERT INTO t1 VALUES ('0123456789'); +flush logs; +DROP TABLE t1; +--exec $MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000011 | grep 'Query' | sed 's/[0-9]\{1,\}/REMOVED/g' + --echo End of 5.0 tests diff --git a/mysql-test/t/rpl_change_master.test b/mysql-test/t/rpl_change_master.test index 6c055a81ceb..9dd1505af90 100644 --- a/mysql-test/t/rpl_change_master.test +++ b/mysql-test/t/rpl_change_master.test @@ -20,11 +20,11 @@ connection slave; stop slave; --replace_result $MASTER_MYPORT MASTER_MYPORT --replace_column 1 # 8 # 9 # 23 # 33 # -show slave status; +query_vertical show slave status; change master to master_user='root'; --replace_result $MASTER_MYPORT MASTER_MYPORT --replace_column 1 # 8 # 9 # 23 # 33 # -show slave status; +query_vertical show slave status; start slave; sync_with_master; select * from t1; |