mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
b0b315dce3
Don't create temporary objects with no table name myisam/mi_open.c: After merge fix mysql-test/r/analyse.result: After merge fix mysql-test/r/backup.result: After merge fix mysql-test/r/create.result: After merge fix mysql-test/r/delete.result: After merge fix mysql-test/r/func_like.result: After merge fix mysql-test/r/innodb.result: After merge fix mysql-test/r/rpl_loaddatalocal.result: After merge fix mysql-test/r/type_timestamp.result: After merge fix mysql-test/t/delete.test: Change to not use table 't' sql/sql_class.h: Remove usage of thd when creating 'Table_ident' Don't create temporary objects with no table name sql/sql_derived.cc: Indentation fix sql/sql_select.cc: After merge fix Fixed wrong return -> DBUG_RETURN() sql/sql_yacc.yy: Remove usage of thd when creating 'Table_ident'
67 lines
1.7 KiB
Text
67 lines
1.7 KiB
Text
#
|
|
# Check for problems with delete
|
|
#
|
|
|
|
--disable_warnings
|
|
drop table if exists t1;
|
|
--enable_warnings
|
|
CREATE TABLE t1 (a tinyint(3), b tinyint(5));
|
|
INSERT INTO t1 VALUES (1,1);
|
|
INSERT LOW_PRIORITY INTO t1 VALUES (1,2);
|
|
INSERT INTO t1 VALUES (1,3);
|
|
DELETE from t1 where a=1 limit 1;
|
|
DELETE LOW_PRIORITY from t1 where a=1;
|
|
|
|
INSERT INTO t1 VALUES (1,1);
|
|
DELETE from t1;
|
|
LOCK TABLE t1 write;
|
|
INSERT INTO t1 VALUES (1,2);
|
|
DELETE from t1;
|
|
UNLOCK TABLES;
|
|
INSERT INTO t1 VALUES (1,2);
|
|
SET AUTOCOMMIT=0;
|
|
DELETE from t1;
|
|
SET AUTOCOMMIT=1;
|
|
drop table t1;
|
|
|
|
#
|
|
# Test of delete when the delete will cause a node to disappear and reappear
|
|
# (This assumes a block size of 1024)
|
|
#
|
|
|
|
create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
|
|
insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23);
|
|
delete from t1 where a=26;
|
|
drop table t1;
|
|
create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
|
|
insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
|
|
delete from t1 where a=27;
|
|
drop table t1;
|
|
|
|
CREATE TABLE `t1` (
|
|
`i` int(10) NOT NULL default '0',
|
|
`i2` int(10) NOT NULL default '0',
|
|
PRIMARY KEY (`i`)
|
|
);
|
|
-- error 1054
|
|
DELETE FROM t1 USING t1 WHERE post='1';
|
|
drop table t1;
|
|
|
|
#
|
|
# CHAR(0) bug - not actually DELETE bug, but anyway...
|
|
#
|
|
|
|
CREATE TABLE t1 (
|
|
bool char(0) default NULL,
|
|
not_null varchar(20) binary NOT NULL default '',
|
|
misc integer not null,
|
|
PRIMARY KEY (not_null)
|
|
) TYPE=MyISAM;
|
|
|
|
INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7);
|
|
|
|
select * from t1 where misc > 5 and bool is null;
|
|
delete from t1 where misc > 5 and bool is null;
|
|
select * from t1 where misc > 5 and bool is null;
|
|
|
|
drop table t1;
|