File: insert_myisam.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (36 lines) | stat: -rw-r--r-- 1,326 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--source include/force_myisam_default.inc
--source include/have_myisam.inc

#
# Test problem with bulk insert and auto_increment on second part keys
#

create table t1 (sid char(20), id int(2) NOT NULL auto_increment, key(sid, id)) engine=myisam;
insert into t1 values ('skr',NULL),('skr',NULL),('test',NULL);
--sorted_result
select * from t1;
insert into t1 values ('rts',NULL),('rts',NULL),('test',NULL);
--sorted_result
select * from t1;
drop table t1;

# Test of INSERT IGNORE and re-using auto_increment values
create table t1 (id int primary key auto_increment, data int, unique(data)) engine=myisam;
insert ignore into t1 values(NULL,100),(NULL,110),(NULL,120);
insert ignore into t1 values(NULL,10),(NULL,20),(NULL,110),(NULL,120),(NULL,100),(NULL,90);
insert ignore into t1 values(NULL,130),(NULL,140),(500,110),(550,120),(450,100),(NULL,150);
select * from t1 order by id;
drop table t1;

--echo #
--echo # Bug#22635253: ASSERTION `THD->IS_ERROR() BOOL
--echo #               SQL_CMD_INSERT::MYSQL_INSERT(THD*, TABLE_LIST*)
--echo #

CREATE TABLE t1(a INT PRIMARY KEY, b INT) ENGINE=MyISAM;
CREATE TABLE t2(a INT) ENGINE=MyISAM;
CREATE TRIGGER trig1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (1);
# This statement used to give an assert on debug builds
INSERT INTO t1(b) VALUES (1);
DROP TABLE t2, t1;