summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-02-09 12:31:03 +0100
committerunknown <monty@mysql.com>2004-02-09 12:31:03 +0100
commit35b1f5445056951dda823b6ec4ee6f06ca612714 (patch)
tree4cdb6965fba280ace2fc30421a0f25332597e43e /mysql-test/t
parent44289ba6587b7a2151b4bd3aa7bd5f3b282454d5 (diff)
downloadmariadb-git-35b1f5445056951dda823b6ec4ee6f06ca612714.tar.gz
Added --compact to mysqlbinlog
Fixed output from mysqlbinlog when using --skip-comments Fixed warnings from valgrind Fixed ref_length when used with HEAP tables More efficent need_conversion() Fixed error handling in UPDATE with not updateable tables Fixed bug in null handling in CAST to signed/unsigned client/client_priv.h: cleanup & added OPT_COMPACT client/mysqldump.c: Added option --compact to get a compact readable dump. Ensure that SET CHARACTER_SET_CLIENT is not done if we have not remembered the old character set Print optimization comments even if --skip-comments are given as these are not true comments. (Before these where only printed at end, which was a bug) mysql-test/r/cast.result: More cast tests mysql-test/r/derived.result: Removed warnings mysql-test/r/mysqldump.result: Update results after fixing mysqlbinlog mysql-test/r/query_cache.result: Make test usable with --extern more tests mysql-test/r/rpl_until.result: Make test repeatable under valgrind mysql-test/r/sql_mode.result: Fix test result mysql-test/r/subselect.result: Make test smaller. Update wrong results mysql-test/t/cast.test: More cast tests mysql-test/t/derived.test: Removed warnings mysql-test/t/query_cache.test: Make test usable with --extern more tests mysql-test/t/rpl_until.test: fix for valgrind. Becasue of unknown reason one got 'Slave_SQL_Running=yes' in this setup mysql-test/t/subselect.test: Make test case smaller sql/field.cc: Updated need_conversion() to use new arguments sql/ha_heap.cc: Moved initialization of ref_length to right place. This fixed problem that we had a ref_length of 8 for heap tables, which was not efficent. sql/item_func.cc: Cleanup sql/item_func.h: Fixed bug in null_handling for cast to signed/unsigned sql/item_strfunc.cc: Optimized/cleaned up Item_func_conv_charset3 sql/item_sum.cc: Cleanup. Ensure that some flag variables are cleared in cleanup() sql/item_sum.h: Fixed references to uninitialized memory sql/opt_range.cc: Fixed spelling error sql/sql_class.cc: Fixed wrong return code, which could case protocol problems sql/sql_class.h: After merge fix sql/sql_prepare.cc: Added comments sql/sql_show.cc: Cleanup sql/sql_string.cc: Optimzed usage of need_conversion(). - Removed not used argument - Save diff lenght in 'offset' to not have to recalculate length several times. Cleaned up comment Optimized copy_aligned() based on the knowledge that it's only called when you have wrong data sql/sql_string.h: Updated need_conversion() and copy_aligned() to use new arguments sql/sql_update.cc: Fixed error handling with non-updateable tables sql/sql_yacc.yy: Ensure that lex->lock_options are set correctly (to get rid of warnings from valgrind) Ensure that cast_type sets lex->charset and lex->length. Without these CONVERT() didn't work properly
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/cast.test9
-rw-r--r--mysql-test/t/derived.test4
-rw-r--r--mysql-test/t/query_cache.test8
-rw-r--r--mysql-test/t/rpl_until.test5
-rw-r--r--mysql-test/t/subselect.test64
5 files changed, 39 insertions, 51 deletions
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index e1cfe5760ee..ab0242990fc 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -10,10 +10,17 @@ select cast(-5 as unsigned) -1, cast(-5 as unsigned) + 1;
select ~5, cast(~5 as signed);
explain extended select ~5, cast(~5 as signed);
select cast(5 as unsigned) -6.0;
+select cast(NULL as signed), cast(1/0 as signed);
+select cast(NULL as unsigned), cast(1/0 as unsigned);
select cast("A" as binary) = "a", cast(BINARY "a" as CHAR) = "A";
select cast("2001-1-1" as DATE), cast("2001-1-1" as DATETIME);
select cast("1:2:3" as TIME);
select CONVERT("2004-01-22 21:45:33",DATE);
+select CONVERT(DATE "2004-01-22 21:45:33" USING latin1);
+select CONVERT(DATE "2004-01-22 21:45:33",CHAR);
+select CONVERT(DATE "2004-01-22 21:45:33",CHAR(4));
+select CONVERT(DATE "2004-01-22 21:45:33",CHAR(4) BINARY);
+select CAST(DATE "2004-01-22 21:45:33" AS CHAR(4) BINARY);
#
# Character set convertion
@@ -21,6 +28,8 @@ select CONVERT("2004-01-22 21:45:33",DATE);
set names binary;
select cast(_latin1'test' as char character set latin2);
select cast(_koi8r'ΤΕΣΤ' as char character set cp1251);
+select convert(_latin1'test', "latin1_german1_ci", "latin1_swedish_ci");
+select convert(_koi8r'ΤΕΣΤ', "koi8r_general_ci", "cp1251_general_ci");
create table t1 select cast(_koi8r'ΤΕΣΤ' as char character set cp1251) as t;
show create table t1;
drop table t1;
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index 154fc4b3834..8646a98551f 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -147,7 +147,7 @@ drop table t1;
CREATE TABLE `t1` (
`N` int(11) unsigned NOT NULL default '0',
`M` tinyint(1) default '0',
-) TYPE=MyISAM DEFAULT CHARSET=latin1;
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `t1` (N, M) VALUES (1, 0),(1, 0),(1, 0),(2, 0),(2, 0),(3, 0);
UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2;
select * from t1;
@@ -167,7 +167,7 @@ CREATE TABLE t1 (
SORTORDER int(11) NOT NULL auto_increment,
KEY t1_SortIndex (SORTORDER),
KEY t1_IdIndex (OBJECTID)
-) TYPE=MyISAM DEFAULT CHARSET=latin1;
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE t2 (
ID int(11) default NULL,
PARID int(11) default NULL,
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index dba5619b777..5ae2039138d 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -466,8 +466,10 @@ select * from t1 where id=2;
create table t1 (word char(20) not null);
select * from t1;
show status like "Qcache_queries_in_cache";
-load data infile '../../std_data/words.dat' into table t1;
+--replace_result $MYSQL_TEST_DIR TEST_DIR
+eval load data infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
show status like "Qcache_queries_in_cache";
+select count(*) from t1;
drop table t1;
#
@@ -476,7 +478,9 @@ drop table t1;
create table t1 (a int);
insert into t1 values (1),(2),(3);
show status like "Qcache_queries_in_cache";
-select * from t1 into outfile "query_caceh.out.file";
+select * from t1 into outfile "query_cache.out.file";
+--error 1086
+select * from t1 into outfile "query_cache.out.file";
select * from t1 limit 1 into dumpfile "query_cache.dump.file";
show status like "Qcache_queries_in_cache";
drop table t1;
diff --git a/mysql-test/t/rpl_until.test b/mysql-test/t/rpl_until.test
index 4508fbea194..937a8c03f99 100644
--- a/mysql-test/t/rpl_until.test
+++ b/mysql-test/t/rpl_until.test
@@ -59,10 +59,11 @@ stop slave;
# this should stop immideately
start slave until master_log_file='master-bin.000001', master_log_pos=561;
---real-sleep 2;
+# 2 is not enough when running with valgrind
+--real-sleep 4;
# here the sql slave thread should be stopped
--replace_result $MASTER_MYPORT MASTER_MYPORT bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
---replace_column 1 # 9 # 23 # 33 #
+--replace_column 1 # 9 # 12 # 23 # 33 #
show slave status;
#testing various error conditions
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index c4392186055..6c53c70c9a0 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -1026,52 +1026,26 @@ drop table t1;
# Bug 2479
#
-CREATE TABLE t1 (
-id int(11) NOT NULL auto_increment,
-ts timestamp NOT NULL,
-id_cns tinyint(3) unsigned NOT NULL default '0',
-id_desc_nota int(11) NOT NULL default '1',
-id_publ_uff int(11) NOT NULL default '0',
-tipo enum('','UNO','DUE') NOT NULL default '',
-f_aggiunte set('TRE','TRETRE','QUATTRO','CINQUE','SEI','SETTE') NOT NULL
-default '',
-anno_dep smallint(4) unsigned zerofill NOT NULL default '0000',
-data_dep smallint(4) unsigned zerofill NOT NULL default '0000',
-particolare mediumint(8) unsigned NOT NULL default '0',
-generale mediumint(8) unsigned NOT NULL default '0',
-bis tinyint(3) unsigned NOT NULL default '0',
-PRIMARY KEY(id),
-UNIQUE KEY idx_cns_gen_anno (anno_dep,id_cns,generale,particolare),
-UNIQUE KEY idx_cns_par_anno (id_cns,anno_dep,tipo,particolare,bis)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 PACK_KEYS=1;
-
-INSERT INTO t1 (id, ts, id_cns, id_desc_nota, id_publ_uff, tipo, f_aggiunte,
-anno_dep, data_dep, particolare, generale, bis) VALUES
-(NULL, NULL, 16, 29, 622, 'UNO', '', 1987, 1218, 2048, 9681, 0),
-(NULL, NULL, 50, 23, 1717, 'UNO', '', 1987, 1126, 1536, 13987, 0),
-(NULL, NULL, 16, 123, 123, 'UNO', '', 1987, 1221, 2432, 14594, 0),
-(NULL, NULL, 16, 124, 124, 'UNO', '', 1987, 1201, 1792, 13422, 0),
-(NULL, NULL, 16, 125, 125, 'UNO', '', 1987, 0723, 1025, 10240, 0),
-(NULL, NULL, 16, 126, 126, 'UNO', '', 1987, 1204, 1026, 7089, 0);
-
-CREATE TABLE t2 (
-id tinyint(3) unsigned NOT NULL auto_increment,
-descr varchar(40) NOT NULL default '',
-f_servizi set('UNO','DUE') NOT NULL default '',
-data_uno_min int(8) unsigned NOT NULL default '0',
-data_due_min int(8) unsigned NOT NULL default '0',
-max_anno_dep smallint(6) unsigned NOT NULL default '0',
-data_agg int(8) unsigned NOT NULL default '0',
-PRIMARY KEY (id)
+CREATE TABLE `t1` (
+ `id` int(11) NOT NULL auto_increment,
+ `id_cns` tinyint(3) unsigned NOT NULL default '0',
+ `tipo` enum('','UNO','DUE') NOT NULL default '',
+ `anno_dep` smallint(4) unsigned zerofill NOT NULL default '0000',
+ `particolare` mediumint(8) unsigned NOT NULL default '0',
+ `generale` mediumint(8) unsigned NOT NULL default '0',
+ `bis` tinyint(3) unsigned NOT NULL default '0',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `idx_cns_gen_anno` (`anno_dep`,`id_cns`,`generale`,`particolare`),
+ UNIQUE KEY `idx_cns_par_anno` (`id_cns`,`anno_dep`,`tipo`,`particolare`,`bis`)
);
+INSERT INTO `t1` VALUES (1,16,'UNO',1987,2048,9681,0),(2,50,'UNO',1987,1536,13987,0),(3,16,'UNO',1987,2432,14594,0),(4,16,'UNO',1987,1792,13422,0),(5,16,'UNO',1987,1025,10240,0),(6,16,'UNO',1987,1026,7089,0);
+CREATE TABLE `t2` (
+ `id` tinyint(3) unsigned NOT NULL auto_increment,
+ `max_anno_dep` smallint(6) unsigned NOT NULL default '0',
+ PRIMARY KEY (`id`)
+);
+INSERT INTO `t2` VALUES (16,1987),(50,1990),(51,1990);
-INSERT INTO t2 (id, descr, f_servizi, data_uno_min, data_due_min,
-max_anno_dep, data_agg) VALUES
-(16, 'C_UNO', 'UNO,DUE', 19000000, 30000000, 1987, 0),
-(50, 'C_TRE', 'UNO', 19000000, 30000000, 1990, 0);
-
-SELECT cns.max_anno_dep = (SELECT s.anno_dep FROM t1 AS s WHERE
-s.id_cns = cns.id ORDER BY s.anno_dep DESC LIMIT 1) AS PIPPO FROM
-t2 AS cns;
+SELECT cns.id, cns.max_anno_dep, cns.max_anno_dep = (SELECT s.anno_dep FROM t1 AS s WHERE s.id_cns = cns.id ORDER BY s.anno_dep DESC LIMIT 1) AS PIPPO FROM t2 AS cns;
DROP TABLE t1, t2;