diff options
author | unknown <monty@mysql.com> | 2004-08-26 18:26:38 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-08-26 18:26:38 +0300 |
commit | 44b2807e4bb2383525c3abfd9ad896114dec0796 (patch) | |
tree | c7d296d78817781f8a0bdd6d65ced41030de842c /mysql-test/r | |
parent | 92dfd1bf9a3cc1b2ae720363295acf633b1e7271 (diff) | |
download | mariadb-git-44b2807e4bb2383525c3abfd9ad896114dec0796.tar.gz |
Portability fixes
Fixed bug in end space handle for WHERE text_column="constant"
heap/hp_hash.c:
Optimzations (no change of logic)
libmysql/libmysql.c:
Added missing casts (portability fix)
myisam/mi_key.c:
Changed macro to take arguments and not depend on local variables
Simple indentation fixes ?
mysql-test/r/connect.result:
Added test for setting empty password
mysql-test/r/create_select_tmp.result:
TYPE -> ENGINE
mysql-test/r/ctype_utf8.result:
Combine drop's
mysql-test/r/endspace.result:
Added more tests to test end space behaviour
mysql-test/r/having.result:
Added missing DROP TABLE
mysql-test/r/type_blob.result:
Added more tests to ensure that fix for BLOB usage is correct
mysql-test/r/type_timestamp.result:
Add test from 4.0
mysql-test/t/connect.test:
Added test for setting empty password
mysql-test/t/create_select_tmp.test:
TYPE -> ENGINE
mysql-test/t/ctype_utf8.test:
Combine drop's
mysql-test/t/endspace.test:
Added more tests to test end space behaviour
mysql-test/t/having.test:
Added missing DROP TABLE
mysql-test/t/type_blob.test:
Added more tests to ensure that fix for BLOB usage is correct
mysql-test/t/type_timestamp.test:
Add test from 4.0
sql/field.cc:
Removed not used variable
Portability fix (cast)
Simplified Field_str::double()
Simple indentation cleanups
sql/field.h:
Removed not needed class variable
sql/item_cmpfunc.cc:
Indentation fix
sql/item_strfunc.cc:
Use on stack variable for Item_str_func::val() instead of str_value.
This makes it safe to use str_value inside the Item's val function.
Cleaned up LEFT() usage, thanks to the above change
sql/item_sum.cc:
Indentation cleanups
sql/protocol.cc:
Added missing cast
sql/sql_acl.cc:
Indentatin cleanups.
Added missing cast
Simple optimization of get_sort()
sql/sql_select.cc:
Don't use 'ref' to search on text field that is not of type BINARY (use 'range' instead).
The reson is that for 'ref' we use 'index_next_same' to read the next possible row.
For text fields, rows in a ref may not come in order, like for 'x', 'x\t' 'x ' (stored in this order) which causes a search for 'column='x ' to fail
sql/tztime.cc:
Simple cleanup
strings/ctype-bin.c:
Comment fixes
strings/ctype-mb.c:
Changed variable names for arguments
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/connect.result | 1 | ||||
-rw-r--r-- | mysql-test/r/create_select_tmp.result | 8 | ||||
-rw-r--r-- | mysql-test/r/ctype_utf8.result | 3 | ||||
-rw-r--r-- | mysql-test/r/endspace.result | 43 | ||||
-rw-r--r-- | mysql-test/r/having.result | 1 | ||||
-rw-r--r-- | mysql-test/r/type_blob.result | 20 | ||||
-rw-r--r-- | mysql-test/r/type_timestamp.result | 12 |
7 files changed, 70 insertions, 18 deletions
diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index ae0def02399..edf30e7f6e4 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -40,6 +40,7 @@ show tables; Tables_in_test update mysql.user set password=old_password("gambling2") where user=_binary"test"; flush privileges; +set password=""; set password='gambling3'; ERROR HY000: Password hash should be a 41-digit hexadecimal number set password=old_password('gambling3'); diff --git a/mysql-test/r/create_select_tmp.result b/mysql-test/r/create_select_tmp.result index 09ffc9013c7..b99bf3e3591 100644 --- a/mysql-test/r/create_select_tmp.result +++ b/mysql-test/r/create_select_tmp.result @@ -1,19 +1,19 @@ drop table if exists t1, t2; CREATE TABLE t1 ( a int ); INSERT INTO t1 VALUES (1),(2),(1); -CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1; +CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1; ERROR 23000: Duplicate entry '1' for key 1 select * from t2; ERROR 42S02: Table 'test.t2' doesn't exist -CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=INNODB SELECT a FROM t1; +CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1; ERROR 23000: Duplicate entry '1' for key 1 select * from t2; ERROR 42S02: Table 'test.t2' doesn't exist -CREATE TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1; +CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1; ERROR 23000: Duplicate entry '1' for key 1 select * from t2; ERROR 42S02: Table 'test.t2' doesn't exist -CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) TYPE=MYISAM SELECT a FROM t1; +CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1; ERROR 23000: Duplicate entry '1' for key 1 select * from t2; ERROR 42S02: Table 'test.t2' doesn't exist diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 38fc8e17d14..f3be539251a 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1,5 +1,4 @@ -drop table if exists t1; -drop table if exists t2; +drop table if exists t1,t2; set names utf8; select left(_utf8 0xD0B0D0B1D0B2,1); left(_utf8 0xD0B0D0B1D0B2,1) diff --git a/mysql-test/r/endspace.result b/mysql-test/r/endspace.result index 167adea6674..bca1717eeba 100644 --- a/mysql-test/r/endspace.result +++ b/mysql-test/r/endspace.result @@ -52,13 +52,13 @@ select * from t1 ignore key (key1) where text1='teststring' or text1 like 'tests text1 teststring teststring -select * from t1 where text1='teststring' or text1 like 'teststring_%'; -text1 -teststring -teststring -select * from t1 where text1='teststring' or text1 > 'teststring\t'; -text1 -teststring +select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%'; +concat('|', text1, '|') +|teststring | +|teststring| +select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t'; +concat('|', text1, '|') +|teststring| select text1, length(text1) from t1 order by text1; text1 length(text1) nothing 7 @@ -77,7 +77,28 @@ concat('|', text1, '|') |teststring| |teststring | |teststring | +select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t'; +concat('|', text1, '|') +|teststring| +|teststring | +select concat('|', text1, '|') from t1 where text1='teststring'; +concat('|', text1, '|') +|teststring| +select concat('|', text1, '|') from t1 where text1='teststring '; +concat('|', text1, '|') +|teststring | alter table t1 modify text1 text not null, pack_keys=1; +select concat('|', text1, '|') from t1 where text1='teststring'; +concat('|', text1, '|') +|teststring| +|teststring | +select concat('|', text1, '|') from t1 where text1='teststring '; +concat('|', text1, '|') +|teststring| +|teststring | +explain select concat('|', text1, '|') from t1 where text1='teststring '; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range key1 key1 22 NULL 2 Using where select * from t1 where text1 like 'teststring_%'; text1 teststring @@ -87,10 +108,10 @@ text1 teststring teststring teststring -select * from t1 where text1='teststring' or text1 > 'teststring\t'; -text1 -teststring -teststring +select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t'; +concat('|', text1, '|') +|teststring| +|teststring | select concat('|', text1, '|') from t1 order by text1; concat('|', text1, '|') |nothing| diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index f7e0bbf3e2c..218276406b1 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -127,3 +127,4 @@ having (a.description is not null) and (c=0); id description c 1 test 0 2 test2 0 +drop table t1,t2,t3; diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 580fc9a8d0b..95bba1d4ec7 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -593,9 +593,12 @@ create table t1 (id integer primary key auto_increment, txt text, unique index t insert into t1 (txt) values ('Chevy'), ('Chevy '), (NULL); select * from t1 where txt='Chevy' or txt is NULL; id txt +3 NULL 1 Chevy 2 Chevy -3 NULL +explain select * from t1 where txt='Chevy' or txt is NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range txt_index txt_index 23 NULL 2 Using where select * from t1 where txt='Chevy '; id txt 1 Chevy @@ -663,6 +666,21 @@ id txt 1 Chevy 2 Chevy 4 Ford +alter table t1 modify column txt blob; +explain select * from t1 where txt='Chevy' or txt is NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref_or_null txt_index txt_index 23 const 2 Using where +select * from t1 where txt='Chevy' or txt is NULL; +id txt +1 Chevy +3 NULL +explain select * from t1 where txt='Chevy' or txt is NULL order by txt; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref_or_null txt_index txt_index 23 const 2 Using where; Using filesort +select * from t1 where txt='Chevy' or txt is NULL order by txt; +id txt +3 NULL +1 Chevy drop table t1; CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, PRIMARY KEY (i), KEY (c(1),c(1))); INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,''); diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index aa8c0903558..425e4a05586 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -365,3 +365,15 @@ select * from t1; t1 i 2004-04-01 00:00:00 10 drop table t1; +create table t1 (ts timestamp(19)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ts` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +set TIMESTAMP=1000000000; +insert into t1 values (); +select * from t1; +ts +2001-09-09 04:46:40 +drop table t1; |