diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/mysqldump.result | 182 | ||||
-rw-r--r-- | mysql-test/r/show_check.result | 24 | ||||
-rw-r--r-- | mysql-test/t/mysqldump.test | 43 | ||||
-rw-r--r-- | mysql-test/t/show_check.test | 54 |
4 files changed, 253 insertions, 50 deletions
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 7f6107db5e4..9d587b013f0 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1917,7 +1917,7 @@ drop table t1, t2, t3; # Bug#21288 mysqldump segmentation fault when using --where # create table t1 (a int); -mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM `t1` WHERE xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' at line 1 (1064) +mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ `a` FROM `t1` WHERE xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' at line 1 (1064) mysqldump: Got error: 1064: "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' at line 1" when retrieving data from server /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; @@ -5646,3 +5646,183 @@ DELIMITER ; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; +# +# Test for Invisible columns +# +create database d; +use d; +# Invisble field table +create table t1(a int , b int invisible); +insert into t1 values(1); +insert into t1(a,b) values(1,2); +# not invisible field table --complete-insert wont be used +create table t2(a int , b int); +insert into t2(a,b) values(1,2); +insert into t2(a,b) values(1,2); +# Invisble field table +create table t3(invisible int , `a b c & $!@#$%^&*( )` int invisible default 4, `ds=~!@ \# $% ^ & * ( ) _ - = +` int invisible default 5); +insert into t3 values(1); +insert into t3 values(5); +insert into t3 values(2); +insert into t3(`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( ) _ - = +` ) values(1,2,3); +CREATE TABLE t4(ËÏÌÏÎËÁ1 INT); +insert into t4 values(1); +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) INVISIBLE DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t1` (`a`, `b`) VALUES (1,NULL),(1,2); +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t2` VALUES (1,2),(1,2); +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t3` ( + `invisible` int(11) DEFAULT NULL, + `a b c & $!@#$%^&*( )` int(11) INVISIBLE DEFAULT 4, + `ds=~!@ \# $% ^ & * ( ) _ - = +` int(11) INVISIBLE DEFAULT 5 +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t3` (`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( ) _ - = +`) VALUES (1,4,5),(5,4,5),(2,4,5),(1,2,3); +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t4` ( + `ËÏÌÏÎËÁ1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t4` VALUES (1); +#Check side effect on --complete insert +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) INVISIBLE DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t1` (`a`, `b`) VALUES (1,NULL),(1,2); +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t2` (`a`, `b`) VALUES (1,2),(1,2); +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t3` ( + `invisible` int(11) DEFAULT NULL, + `a b c & $!@#$%^&*( )` int(11) INVISIBLE DEFAULT 4, + `ds=~!@ \# $% ^ & * ( ) _ - = +` int(11) INVISIBLE DEFAULT 5 +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t3` (`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( ) _ - = +`) VALUES (1,4,5),(5,4,5),(2,4,5),(1,2,3); +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t4` ( + `ËÏÌÏÎËÁ1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t4` (`ËÏÌÏÎËÁ1`) VALUES (1); +#Check xml +<?xml version="1.0"?> +<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +<database name="d"> + <table_structure name="t1"> + <field Field="a" Type="int(11)" Null="YES" Key="" Default="NULL" Extra="" Comment="" /> + <field Field="b" Type="int(11)" Null="YES" Key="" Default="NULL" Extra="INVISIBLE" Comment="" /> + </table_structure> + <table_data name="t1"> + <row> + <field name="a">1</field> + <field name="b" xsi:nil="true" /> + </row> + <row> + <field name="a">1</field> + <field name="b">2</field> + </row> + </table_data> + <table_structure name="t2"> + <field Field="a" Type="int(11)" Null="YES" Key="" Default="NULL" Extra="" Comment="" /> + <field Field="b" Type="int(11)" Null="YES" Key="" Default="NULL" Extra="" Comment="" /> + </table_structure> + <table_data name="t2"> + <row> + <field name="a">1</field> + <field name="b">2</field> + </row> + <row> + <field name="a">1</field> + <field name="b">2</field> + </row> + </table_data> + <table_structure name="t3"> + <field Field="invisible" Type="int(11)" Null="YES" Key="" Default="NULL" Extra="" Comment="" /> + <field Field="a b c & $!@#$%^&*( )" Type="int(11)" Null="YES" Key="" Default="4" Extra="INVISIBLE" Comment="" /> + <field Field="ds=~!@ \# $% ^ & * ( ) _ - = +" Type="int(11)" Null="YES" Key="" Default="5" Extra="INVISIBLE" Comment="" /> + </table_structure> + <table_data name="t3"> + <row> + <field name="invisible">1</field> + <field name="a b c & $!@#$%^&*( )">4</field> + <field name="ds=~!@ \# $% ^ & * ( ) _ - = +">5</field> + </row> + <row> + <field name="invisible">5</field> + <field name="a b c & $!@#$%^&*( )">4</field> + <field name="ds=~!@ \# $% ^ & * ( ) _ - = +">5</field> + </row> + <row> + <field name="invisible">2</field> + <field name="a b c & $!@#$%^&*( )">4</field> + <field name="ds=~!@ \# $% ^ & * ( ) _ - = +">5</field> + </row> + <row> + <field name="invisible">1</field> + <field name="a b c & $!@#$%^&*( )">2</field> + <field name="ds=~!@ \# $% ^ & * ( ) _ - = +">3</field> + </row> + </table_data> + <table_structure name="t4"> + <field Field="ËÏÌÏÎËÁ1" Type="int(11)" Null="YES" Key="" Default="NULL" Extra="" Comment="" /> + </table_structure> + <table_data name="t4"> + <row> + <field name="ËÏÌÏÎËÁ1">1</field> + </row> + </table_data> +</database> +</mysqldump> +DROP table t1,t2,t3; +select * from t1; +a +1 +1 +select a,b from t1; +a b +1 NULL +1 2 +select * from t2; +a b +1 2 +1 2 +select * from t3; +invisible +1 +5 +2 +1 +desc t3; +Field Type Null Key Default Extra +invisible int(11) YES NULL +a b c & $!@#$%^&*( ) int(11) YES 4 INVISIBLE +ds=~!@ \# $% ^ & * ( ) _ - = + int(11) YES 5 INVISIBLE +drop database d; diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index d17469abae5..af0fadb4038 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -1206,26 +1206,6 @@ DROP TABLE t1; DROP VIEW v1; DROP PROCEDURE p1; DROP FUNCTION f1; -set names koi8r; -DROP DATABASE IF EXISTS mysqltest1; -CREATE DATABASE mysqltest1; -use mysqltest1; -CREATE TABLE t1(1 INT); - ----> Dumping mysqltest1 to outfile1 - - -DROP DATABASE mysqltest1; - - ----> Restoring mysqltest1... -SHOW CREATE TABLE mysqltest1.t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `1` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -DROP DATABASE mysqltest1; -use test; flush status; show variables like "log_queries_not_using_indexes"; Variable_name Value @@ -1273,8 +1253,8 @@ PRIMARY KEY (Codigo) ) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; show create table t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 64 2 N 1 39 7 -def Create Table 253 1024 458 N 1 39 7 +def Table 253 192 2 N 1 39 33 +def Create Table 253 3072 458 N 1 39 33 Table Create Table t1 CREATE TABLE `t1` ( `Codigo` int(10) unsigned NOT NULL AUTO_INCREMENT, diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 9f74f4ad9c0..85f60964c3b 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2646,3 +2646,46 @@ CREATE TRIGGER tt1_t1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t1 (a) VALUES (1),(2),(3); --exec $MYSQL_DUMP --triggers --no-data --no-create-info --add-drop-trigger --skip-comments --databases test DROP TABLE t1; +--echo # +--echo # Test for Invisible columns +--echo # +create database d; +use d; + +--echo # Invisble field table +create table t1(a int , b int invisible); +insert into t1 values(1); +insert into t1(a,b) values(1,2); + +--echo # not invisible field table --complete-insert wont be used +create table t2(a int , b int); +insert into t2(a,b) values(1,2); +insert into t2(a,b) values(1,2); + +--echo # Invisble field table +create table t3(invisible int , `a b c & $!@#$%^&*( )` int invisible default 4, `ds=~!@ \# $% ^ & * ( ) _ - = +` int invisible default 5); +insert into t3 values(1); +insert into t3 values(5); +insert into t3 values(2); +insert into t3(`invisible`, `a b c & $!@#$%^&*( )`, `ds=~!@ \# $% ^ & * ( ) _ - = +` ) values(1,2,3); +CREATE TABLE t4(ËÏÌÏÎËÁ1 INT); +insert into t4 values(1); +--exec $MYSQL_DUMP --compact d + +--echo #Check side effect on --complete insert +--exec $MYSQL_DUMP --compact --complete-insert d +--echo #Check xml +--exec $MYSQL_DUMP --skip-create-options --skip-comments -X d + +#import data +--exec $MYSQL_DUMP --skip-comments d > $MYSQLTEST_VARDIR/tmp/invisible_dump.sql +DROP table t1,t2,t3; + +--exec $MYSQL d < $MYSQLTEST_VARDIR/tmp/invisible_dump.sql + +select * from t1; +select a,b from t1; +select * from t2; +select * from t3; +desc t3; +drop database d; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index d84226460f2..a24fa632ea5 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -890,62 +890,62 @@ DROP FUNCTION f1; # Part 2: check that table with non-latin1 characters are dumped/restored # correctly. # - +# See MDEV-14651 for details # Ensure that all needed objects are dropped. -set names koi8r; +#set names koi8r; ---disable_warnings -DROP DATABASE IF EXISTS mysqltest1; ---enable_warnings +#--disable_warnings +#DROP DATABASE IF EXISTS mysqltest1; +#--enable_warnings # Create objects. -CREATE DATABASE mysqltest1; +#CREATE DATABASE mysqltest1; -use mysqltest1; +#use mysqltest1; -CREATE TABLE t1(1 INT); +#CREATE TABLE t1(1 INT); # Check: # - Dump mysqltest1; ---let $outfile1=$MYSQLTEST_VARDIR/tmp/show_check.mysqltest1.sql +#--let $outfile1=$MYSQLTEST_VARDIR/tmp/show_check.mysqltest1.sql ---source include/count_sessions.inc ---echo ---echo ---> Dumping mysqltest1 to outfile1 ---exec $MYSQL_DUMP --default-character-set=latin1 --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqltest1 > $outfile1 +#--source include/count_sessions.inc +#--echo +#--echo ---> Dumping mysqltest1 to outfile1 +#--exec $MYSQL_DUMP --default-character-set=latin1 --character-sets-dir=$MYSQL_SHAREDIR/charsets --databases mysqltest1 > $outfile1 # Take care that the additional session caused by MYSQL_DUMP has disappeared. ---source include/wait_until_count_sessions.inc +#--source include/wait_until_count_sessions.inc # - Clean mysqltest1; ---echo ---echo +#--echo +#--echo -DROP DATABASE mysqltest1; +#DROP DATABASE mysqltest1; # - Restore mysqltest1; ---echo ---echo +#--echo +#--echo ---source include/count_sessions.inc ---echo ---> Restoring mysqltest1... ---exec $MYSQL test < $outfile1 ---remove_file $outfile1 +#--source include/count_sessions.inc +#--echo ---> Restoring mysqltest1... +#--exec $MYSQL test < $outfile1 +#--remove_file $outfile1 # Take care that the additional session caused by MYSQL has disappeared. ---source include/wait_until_count_sessions.inc +#--source include/wait_until_count_sessions.inc # - Check definition of the table. -SHOW CREATE TABLE mysqltest1.t1; +#SHOW CREATE TABLE mysqltest1.t1; # Cleanup. -DROP DATABASE mysqltest1; -use test; +#DROP DATABASE mysqltest1; +#use test; # # Bug#28808 log_queries_not_using_indexes variable dynamic change is ignored |