49
46
(246,3),(253,3),(269,3),(285,3),(291,3),(293,3),(131,4),(230,4),(231,4);
52
slai_id int not null default '0',
53
owner_tbl int default null,
54
owner_id int default null,
55
sla_id int default null,
56
inc_web int default null,
57
inc_email int default null,
58
inc_chat int default null,
59
inc_csr int default null,
60
inc_total int default null,
61
time_billed int default null,
49
slai_id int(11) not null default '0',
50
owner_tbl int(11) default null,
51
owner_id int(11) default null,
52
sla_id int(11) default null,
53
inc_web int(11) default null,
54
inc_email int(11) default null,
55
inc_chat int(11) default null,
56
inc_csr int(11) default null,
57
inc_total int(11) default null,
58
time_billed int(11) default null,
62
59
activedate timestamp null default null,
63
60
expiredate timestamp null default null,
64
state int default null,
65
sla_set int default null,
61
state int(11) default null,
62
sla_set int(11) default null,
66
63
unique key t2$slai_id (slai_id),
67
64
key t2$owner_id (owner_id),
68
65
key t2$sla_id (sla_id)
489
# Test needs to be rewritten to not use divide by zero
491
## Bug #28189: optimizer erroniously prefers ref access to range access
492
## for an InnoDB table
496
# id int AUTO_INCREMENT PRIMARY KEY,
497
# stat_id int NOT NULL,
498
# acct_id int DEFAULT NULL,
499
# INDEX idx1 (stat_id, acct_id),
500
# INDEX idx2 (acct_id)
504
# id int AUTO_INCREMENT PRIMARY KEY,
505
# stat_id int NOT NULL,
506
# acct_id int DEFAULT NULL,
507
# INDEX idx1 (stat_id, acct_id),
508
# INDEX idx2 (acct_id)
511
#INSERT INTO t1(stat_id,acct_id) VALUES
512
# (1,759), (2,831), (3,785), (4,854), (1,921),
513
# (1,553), (2,589), (3,743), (2,827), (2,545),
514
# (4,779), (4,783), (1,597), (1,785), (4,832),
515
# (1,741), (1,833), (3,788), (2,973), (1,907);
517
#INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
518
#INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
519
#INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
520
#INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
521
#INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
522
#INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
523
#INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
524
#INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
525
#INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
526
#INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
527
#INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
528
#UPDATE t1 SET acct_id=785
529
# WHERE MOD(stat_id,2)=0 AND MOD(id,stat_id)=MOD(acct_id,stat_id);
532
#SELECT COUNT(*) FROM t1;
533
#SELECT COUNT(*) FROM t1 WHERE acct_id=785;
535
#EXPLAIN SELECT COUNT(*) FROM t1 WHERE stat_id IN (1,3) AND acct_id=785;
537
#INSERT INTO t2 SELECT * FROM t1;
540
#EXPLAIN SELECT COUNT(*) FROM t2 WHERE stat_id IN (1,3) AND acct_id=785;
487
# Bug #28189: optimizer erroniously prefers ref access to range access
488
# for an InnoDB table
492
id int AUTO_INCREMENT PRIMARY KEY,
493
stat_id int NOT NULL,
494
acct_id int DEFAULT NULL,
495
INDEX idx1 (stat_id, acct_id),
500
id int AUTO_INCREMENT PRIMARY KEY,
501
stat_id int NOT NULL,
502
acct_id int DEFAULT NULL,
503
INDEX idx1 (stat_id, acct_id),
507
INSERT INTO t1(stat_id,acct_id) VALUES
508
(1,759), (2,831), (3,785), (4,854), (1,921),
509
(1,553), (2,589), (3,743), (2,827), (2,545),
510
(4,779), (4,783), (1,597), (1,785), (4,832),
511
(1,741), (1,833), (3,788), (2,973), (1,907);
513
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
514
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
515
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
516
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
517
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
518
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
519
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
520
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
521
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
522
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
523
INSERT INTO t1(stat_id,acct_id) SELECT stat_id, mod(id+100000, acct_id) FROM t1;
524
UPDATE t1 SET acct_id=785
525
WHERE MOD(stat_id,2)=0 AND MOD(id,stat_id)=MOD(acct_id,stat_id);
528
SELECT COUNT(*) FROM t1;
529
SELECT COUNT(*) FROM t1 WHERE acct_id=785;
531
EXPLAIN SELECT COUNT(*) FROM t1 WHERE stat_id IN (1,3) AND acct_id=785;
533
INSERT INTO t2 SELECT * FROM t1;
536
EXPLAIN SELECT COUNT(*) FROM t2 WHERE stat_id IN (1,3) AND acct_id=785;
545
541
# Bug #28652: assert when alter innodb table operation
547
543
create table t1(a int) engine=innodb;
548
alter table t1 comment='123';
544
alter table t1 comment '123';
549
545
show create table t1;
553
549
# Bug #25866: Getting "#HY000 Can't find record in..." on and INSERT
555
CREATE TABLE t1 (a CHAR(2), KEY (a)) ENGINE = InnoDB;
551
CREATE TABLE t1 (a CHAR(2), KEY (a)) ENGINE = InnoDB DEFAULT CHARSET=UTF8;
556
552
INSERT INTO t1 VALUES ('uk'),('bg');
557
553
SELECT * FROM t1 WHERE a = 'uk';
558
554
DELETE FROM t1 WHERE a = 'uk';
713
758
--source include/innodb_rollback_on_timeout.inc
761
# Bug#27296 Assertion in ALTER TABLE SET DEFAULT in Linux Debug build
762
# (possible deadlock).
764
# The bug is applicable only to a transactoinal table.
765
# Cover with tests behavior that no longer causes an
769
drop table if exists t1;
771
create table t1 (a int) engine=innodb;
772
alter table t1 alter a set default 1;
776
--echo Bug#24918 drop table and lock / inconsistent between
777
--echo perm and temp tables
779
--echo Check transactional tables under LOCK TABLES
782
drop table if exists t24918, t24918_tmp, t24918_trans, t24918_trans_tmp,
785
create table t24918_access (id int);
786
create table t24918 (id int) engine=myisam;
787
create temporary table t24918_tmp (id int) engine=myisam;
788
create table t24918_trans (id int) engine=innodb;
789
create temporary table t24918_trans_tmp (id int) engine=innodb;
791
lock table t24918 write, t24918_tmp write, t24918_trans write, t24918_trans_tmp write;
793
--error ER_TABLE_NOT_LOCKED
794
select * from t24918_access;
795
drop table t24918_trans;
796
--error ER_TABLE_NOT_LOCKED
797
select * from t24918_access;
798
drop table t24918_trans_tmp;
799
--error ER_TABLE_NOT_LOCKED
800
select * from t24918_access;
801
drop table t24918_tmp;
802
--error ER_TABLE_NOT_LOCKED
803
select * from t24918_access;
806
drop table t24918_access;
716
808
# Bug #28591: MySQL need not sort the records in case of ORDER BY
717
809
# primary_key on InnoDB table