mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
a07e48eca0
Added more DBUG statements Ensure that we are comparing end space with BINARY strings Use 'any_db' instead of '' to mean any database. (For HANDLER command) Only strip ' ' when comparing CHAR, not other space-like characters (like \t) BitKeeper/deleted/.del-ctype_tis620.result-old~3578ceb0b8284685: Delete: mysql-test/r/ctype_tis620.result-old BitKeeper/deleted/.del-ctype_tis620.test-old~ffb1bbd2935d1aba: Delete: mysql-test/t/ctype_tis620.test-old client/mysqlbinlog.cc: Added DBUG statements Added call of my_end() to free all used memory on exit heap/hp_info.c: After merge fixes heap/hp_open.c: After merge fixes include/heap.h: After merge fixes include/m_ctype.h: Use pchar instead of 'int' for character parameters. Added 'my_binary_compare()' include/m_string.h: Fixed wrong define innobase/ibuf/ibuf0ibuf.c: After merge fixes innobase/srv/srv0start.c: After merge fixes mysql-test/r/alter_table.result: Fixed results after merge mysql-test/r/auto_increment.result: Fixed results after merge mysql-test/r/bdb.result: Fixed results after merge mysql-test/r/binary.result: Fixed results after merge mysql-test/r/create.result: Fixed results after merge mysql-test/r/ctype_mb.result: Fixed results after merge mysql-test/r/ctype_tis620.result: Fixed results after merge mysql-test/r/ctype_utf8.result: Fixed results after merge mysql-test/r/delete.result: Fixed results after merge mysql-test/r/func_compress.result: Fixed results after merge mysql-test/r/func_gconcat.result: Fixed results after merge mysql-test/r/func_group.result: Fixed results after merge mysql-test/r/func_str.result: Fixed results after merge mysql-test/r/innodb.result: Fixed results after merge mysql-test/r/insert.result: Fixed results after merge mysql-test/r/insert_select.result: Fixed results after merge mysql-test/r/key.result: Fixed results after merge mysql-test/r/loaddata.result: Fixed results after merge mysql-test/r/lock.result: Fixed results after merge mysql-test/r/myisam.result: Fixed results after merge mysql-test/r/null.result: Fixed results after merge mysql-test/r/null_key.result: Fixed results after merge mysql-test/r/order_by.result: Fixed results after merge mysql-test/r/query_cache.result: Fixed results after merge mysql-test/r/range.result: Fixed results after merge mysql-test/r/rpl_multi_delete.result: Fixed results after merge mysql-test/r/rpl_until.result: Fixed results after merge mysql-test/r/subselect.result: Fixed results after merge mysql-test/r/subselect_innodb.result: Fixed results after merge mysql-test/r/type_blob.result: Fixed results after merge mysql-test/r/type_datetime.result: Fixed results after merge mysql-test/r/type_decimal.result: Fixed results after merge mysql-test/r/type_enum.result: Fixed results after merge mysql-test/r/type_float.result: Fixed results after merge mysql-test/r/type_ranges.result: Fixed results after merge mysql-test/r/type_time.result: Fixed results after merge mysql-test/r/type_timestamp.result: Fixed results after merge mysql-test/r/type_uint.result: Fixed results after merge mysql-test/r/type_year.result: Fixed results after merge mysql-test/r/variables.result: Fixed results after merge mysql-test/r/warnings.result: Fixed results after merge mysql-test/t/case.test: Fixed shifted error messages mysql-test/t/create.test: Fixed shifted error messages mysql-test/t/ctype_collate.test: Fixed shifted error messages mysql-test/t/ctype_tis620.test: Merge with 4.0 ctype_tis620 test mysql-test/t/delete.test: Fixed shifted error messages mysql-test/t/derived.test: Fixed shifted error messages mysql-test/t/fulltext.test: Fixed shifted error messages mysql-test/t/func_in.test: Fixed shifted error messages mysql-test/t/func_str.test: Fixed shifted error messages mysql-test/t/func_test.test: Fixed shifted error messages mysql-test/t/grant.test: Fixed shifted error messages mysql-test/t/innodb.test: Change to 4.1 syntax mysql-test/t/key_cache.test: Fixed shifted error messages mysql-test/t/myisam.test: New test of blob and end space mysql-test/t/row.test: Fixed shifted error messages mysql-test/t/rpl_until.test: Fixed shifted error messages mysql-test/t/subselect.test: Fixed shifted error messages mysql-test/t/subselect_innodb.test: Fix test to take into account foreign key constraints mysql-test/t/union.test: Fixed shifted error messages mysql-test/t/user_var.test: Fixed shifted error messages mysql-test/t/variables.test: Fixed shifted error messages mysys/my_handler.c: Merge with 4.0 code sql/ha_heap.cc: After merge fixes sql/handler.cc: After merge fixes sql/item.cc: After merge fixes sql/item_cmpfunc.cc: Ensure that we are comparing end space with BINARY strings sql/item_cmpfunc.h: Ensure that we are comparing end space with BINARY strings sql/log_event.cc: More DBUG statements Ensure that we use all options to LOAD DATA in replication sql/opt_range.cc: After merge fixes sql/sql_db.cc: After merge fixes sql/sql_handler.cc: After merge fixes Use 'any_db' instead of '' to mean 'no database comparison' sql/sql_parse.cc: After merge fixes sql/sql_select.cc: After merge fixes Added function comment for setup_group() sql/sql_string.cc: Added stringcmp() for binary comparison. Added function comments for sortcmp() and stringcmp() sql/sql_string.h: Added stringcmp() sql/sql_table.cc: After merge fixes sql/sql_update.cc: After merge fixes sql/sql_yacc.yy: Use 'any_db' instead of '' to mean any database. Using "" causes a 'wrong db name' error. strings/ctype-big5.c: Strip only end space, not other space characters. strings/ctype-bin.c: Removed some not needed functions. Added function comments Don't remove end space in comparisons Change my_wildcmp_bin() to be 'identical' with other similar code strings/ctype-czech.c: Strip only end space, not other space characters. strings/ctype-gbk.c: Strip only end space, not other space characters. strings/ctype-latin1.c: Strip only end space, not other space characters. strings/ctype-mb.c: Strip only end space, not other space characters. strings/ctype-simple.c: Strip only end space, not other space characters. strings/ctype-sjis.c: Strip only end space, not other space characters. strings/ctype-tis620.c: Added usage of my_instr_simple. This needs to be cleaned up! strings/ctype-utf8.c: Strip only end space, not other space characters. strings/ctype-win1250ch.c: Strip only end space, not other space characters. Fixed indentation strings/strto.c: Code cleanup
272 lines
5.7 KiB
Text
272 lines
5.7 KiB
Text
drop table if exists t1;
|
|
SET SQL_WARNINGS=1;
|
|
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=myisam auto_increment=3;
|
|
insert into t1 values (1,1),(NULL,3),(NULL,4);
|
|
delete from t1 where a=4;
|
|
insert into t1 values (NULL,5),(NULL,6);
|
|
select * from t1;
|
|
a b
|
|
1 1
|
|
3 3
|
|
5 5
|
|
6 6
|
|
delete from t1 where a=6;
|
|
replace t1 values (3,1);
|
|
ALTER TABLE t1 add c int;
|
|
replace t1 values (3,3,3);
|
|
insert into t1 values (NULL,7,7);
|
|
update t1 set a=8,b=b+1,c=c+1 where a=7;
|
|
insert into t1 values (NULL,9,9);
|
|
select * from t1;
|
|
a b c
|
|
1 1 NULL
|
|
3 3 3
|
|
5 5 NULL
|
|
8 8 8
|
|
9 9 9
|
|
drop table t1;
|
|
create table t1 (
|
|
skey tinyint unsigned NOT NULL auto_increment PRIMARY KEY,
|
|
sval char(20)
|
|
);
|
|
insert into t1 values (NULL, "hello");
|
|
insert into t1 values (NULL, "hey");
|
|
select * from t1;
|
|
skey sval
|
|
1 hello
|
|
2 hey
|
|
select _rowid,t1._rowid,skey,sval from t1;
|
|
_rowid _rowid skey sval
|
|
1 1 1 hello
|
|
2 2 2 hey
|
|
drop table t1;
|
|
create table t1 (a char(10) not null, b int not null auto_increment, primary key(a,b));
|
|
insert into t1 values ("a",1),("b",2),("a",2),("c",1);
|
|
insert into t1 values ("a",NULL),("b",NULL),("c",NULL),("e",NULL);
|
|
insert into t1 (a) values ("a"),("b"),("c"),("d");
|
|
insert into t1 (a) values ('k'),('d');
|
|
insert into t1 (a) values ("a");
|
|
insert into t1 values ("d",last_insert_id());
|
|
select * from t1;
|
|
a b
|
|
a 1
|
|
a 2
|
|
a 3
|
|
a 4
|
|
a 5
|
|
b 2
|
|
b 3
|
|
b 4
|
|
c 1
|
|
c 2
|
|
c 3
|
|
d 1
|
|
d 2
|
|
d 5
|
|
e 1
|
|
k 1
|
|
drop table t1;
|
|
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ordid), index(ord,ordid));
|
|
insert into t1 (ordid,ord) values (NULL,'sdj'),(NULL,'sdj');
|
|
select * from t1;
|
|
ordid ord
|
|
1 sdj
|
|
2 sdj
|
|
drop table t1;
|
|
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid));
|
|
insert into t1 values (NULL,'sdj'),(NULL,'sdj'),(NULL,"abc"),(NULL,'abc'),(NULL,'zzz'),(NULL,'sdj'),(NULL,'abc');
|
|
select * from t1;
|
|
ordid ord
|
|
1 abc
|
|
2 abc
|
|
3 abc
|
|
1 sdj
|
|
2 sdj
|
|
3 sdj
|
|
1 zzz
|
|
drop table t1;
|
|
create table t1 (sid char(5), id int(2) NOT NULL auto_increment, key(sid, id));
|
|
create table t2 (sid char(20), id int(2));
|
|
insert into t2 values ('skr',NULL),('skr',NULL),('test',NULL);
|
|
insert into t1 select * from t2;
|
|
select * from t1;
|
|
sid id
|
|
skr 1
|
|
skr 2
|
|
test 1
|
|
drop table t1,t2;
|
|
create table t1 (a int not null primary key auto_increment);
|
|
insert into t1 values (0);
|
|
update t1 set a=0;
|
|
select * from t1;
|
|
a
|
|
0
|
|
check table t1;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 check warning Found row where the auto_increment column has the value 0
|
|
test.t1 check status OK
|
|
drop table t1;
|
|
create table t1 (a int not null auto_increment primary key);
|
|
insert into t1 values (NULL);
|
|
insert into t1 values (-1);
|
|
select last_insert_id();
|
|
last_insert_id()
|
|
1
|
|
insert into t1 values (NULL);
|
|
select * from t1;
|
|
a
|
|
-1
|
|
1
|
|
2
|
|
drop table t1;
|
|
create table t1 (a int not null auto_increment primary key) /*!40102 engine=heap */;
|
|
insert into t1 values (NULL);
|
|
insert into t1 values (-1);
|
|
select last_insert_id();
|
|
last_insert_id()
|
|
1
|
|
insert into t1 values (NULL);
|
|
select * from t1;
|
|
a
|
|
1
|
|
-1
|
|
2
|
|
drop table t1;
|
|
create table t1 (i tinyint unsigned not null auto_increment primary key);
|
|
insert into t1 set i = 254;
|
|
insert into t1 set i = null;
|
|
select last_insert_id();
|
|
last_insert_id()
|
|
255
|
|
explain extended select last_insert_id();
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
|
|
Warnings:
|
|
Note 1003 select high_priority no_cache 255 AS `last_insert_id()`
|
|
insert into t1 set i = 254;
|
|
ERROR 23000: Duplicate entry '254' for key 1
|
|
select last_insert_id();
|
|
last_insert_id()
|
|
255
|
|
insert into t1 set i = null;
|
|
ERROR 23000: Duplicate entry '255' for key 1
|
|
select last_insert_id();
|
|
last_insert_id()
|
|
0
|
|
drop table t1;
|
|
create table t1 (i tinyint unsigned not null auto_increment, key (i));
|
|
insert into t1 set i = 254;
|
|
insert into t1 set i = null;
|
|
select last_insert_id();
|
|
last_insert_id()
|
|
255
|
|
insert into t1 set i = null;
|
|
Warnings:
|
|
Warning 1264 Data truncated, out of range for column 'i' at row 1
|
|
select last_insert_id();
|
|
last_insert_id()
|
|
255
|
|
drop table t1;
|
|
create table t1 (i tinyint unsigned not null auto_increment primary key, b int, unique (b));
|
|
insert into t1 values (NULL, 10);
|
|
select last_insert_id();
|
|
last_insert_id()
|
|
1
|
|
insert into t1 values (NULL, 15);
|
|
select last_insert_id();
|
|
last_insert_id()
|
|
2
|
|
insert into t1 values (NULL, 10);
|
|
ERROR 23000: Duplicate entry '10' for key 2
|
|
select last_insert_id();
|
|
last_insert_id()
|
|
0
|
|
drop table t1;
|
|
create table t1(a int auto_increment,b int null,primary key(a));
|
|
SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
|
|
insert into t1(a,b)values(NULL,1);
|
|
insert into t1(a,b)values(200,2);
|
|
insert into t1(a,b)values(0,3);
|
|
insert into t1(b)values(4);
|
|
insert into t1(b)values(5);
|
|
insert into t1(b)values(6);
|
|
insert into t1(b)values(7);
|
|
select * from t1 order by b;
|
|
a b
|
|
1 1
|
|
200 2
|
|
0 3
|
|
201 4
|
|
202 5
|
|
203 6
|
|
204 7
|
|
delete from t1 where a=0;
|
|
update t1 set a=0 where b=5;
|
|
select * from t1 order by b;
|
|
a b
|
|
1 1
|
|
200 2
|
|
201 4
|
|
0 5
|
|
203 6
|
|
204 7
|
|
delete from t1 where a=0;
|
|
update t1 set a=NULL where b=6;
|
|
Warnings:
|
|
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 4
|
|
update t1 set a=300 where b=7;
|
|
SET SQL_MODE='';
|
|
insert into t1(a,b)values(NULL,8);
|
|
insert into t1(a,b)values(400,9);
|
|
insert into t1(a,b)values(0,10);
|
|
insert into t1(b)values(11);
|
|
insert into t1(b)values(12);
|
|
insert into t1(b)values(13);
|
|
insert into t1(b)values(14);
|
|
select * from t1 order by b;
|
|
a b
|
|
1 1
|
|
200 2
|
|
201 4
|
|
0 6
|
|
300 7
|
|
301 8
|
|
400 9
|
|
401 10
|
|
402 11
|
|
403 12
|
|
404 13
|
|
405 14
|
|
delete from t1 where a=0;
|
|
update t1 set a=0 where b=12;
|
|
select * from t1 order by b;
|
|
a b
|
|
1 1
|
|
200 2
|
|
201 4
|
|
300 7
|
|
301 8
|
|
400 9
|
|
401 10
|
|
402 11
|
|
0 12
|
|
404 13
|
|
405 14
|
|
delete from t1 where a=0;
|
|
update t1 set a=NULL where b=13;
|
|
Warnings:
|
|
Warning 1263 Data truncated, NULL supplied to NOT NULL column 'a' at row 9
|
|
update t1 set a=500 where b=14;
|
|
select * from t1 order by b;
|
|
a b
|
|
1 1
|
|
200 2
|
|
201 4
|
|
300 7
|
|
301 8
|
|
400 9
|
|
401 10
|
|
402 11
|
|
0 13
|
|
500 14
|
|
drop table t1;
|