Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
b974b776
Commit
b974b776
authored
Apr 12, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes after manual merge.
parent
a00a3bb9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
15 deletions
+65
-15
mysql-test/r/innodb.result
mysql-test/r/innodb.result
+53
-4
mysql-test/t/innodb.test
mysql-test/t/innodb.test
+12
-11
No files found.
mysql-test/r/innodb.result
View file @
b974b776
...
...
@@ -2924,13 +2924,13 @@ create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb;
create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb;
insert into t1 values (0x41),(0x4120),(0x4100);
insert into t2 values (0x41),(0x4120),(0x4100);
ERROR 23000: Duplicate entry 'A' for key
1
ERROR 23000: Duplicate entry 'A' for key
'PRIMARY'
insert into t2 values (0x41),(0x4120);
insert into t3 values (0x41),(0x4120),(0x4100);
ERROR 23000: Duplicate entry 'A ' for key
1
ERROR 23000: Duplicate entry 'A ' for key
'PRIMARY'
insert into t3 values (0x41),(0x4100);
insert into t4 values (0x41),(0x4120),(0x4100);
ERROR 23000: Duplicate entry 'A' for key
1
ERROR 23000: Duplicate entry 'A' for key
'PRIMARY'
insert into t4 values (0x41),(0x4100);
select hex(s1) from t1;
hex(s1)
...
...
@@ -3132,7 +3132,7 @@ ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11)
default
NULL,
`a` int(11)
DEFAULT
NULL,
KEY `t2_ibfk_0` (`a`)
)
ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t2,t1;
...
...
@@ -3203,3 +3203,52 @@ where t2.a between t1.a - interval 2 day and t1.a + interval 2 day;
a a
2005-10-01 2005-10-01
drop table t1, t2;
CREATE TABLE t1 (
field1 varchar(8) NOT NULL DEFAULT '',
field2 varchar(8) NOT NULL DEFAULT '',
PRIMARY KEY (field1, field2)
)
ENGINE=InnoDB;
CREATE TABLE t2 (
field1 varchar(8) NOT NULL DEFAULT '' PRIMARY KEY,
FOREIGN KEY (field1) REFERENCES t1 (field1)
ON DELETE CASCADE ON UPDATE CASCADE
)
ENGINE=InnoDB;
INSERT INTO t1 VALUES ('old', 'somevalu');
INSERT INTO t1 VALUES ('other', 'anyvalue');
INSERT INTO t2 VALUES ('old');
INSERT INTO t2 VALUES ('other');
UPDATE t1 SET field1 = 'other' WHERE field2 = 'somevalu';
ERROR 23000: Upholding foreign key constraints for table 't1', entry 'other-somevalu', key 1 would lead to a duplicate entry
DROP TABLE t2;
DROP TABLE t1;
create table t1 (
c1 bigint not null,
c2 bigint not null,
primary key (c1),
unique key (c2)
)
engine=innodb;
create table t2 (
c1 bigint not null,
primary key (c1)
)
engine=innodb;
alter table t1 add constraint c2_fk foreign key (c2)
references t2(c1) on delete cascade;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`c2` bigint(20) NOT NULL,
PRIMARY KEY (`c1`),
UNIQUE KEY `c2` (`c2`),
CONSTRAINT `c2_fk` FOREIGN KEY (`c2`) REFERENCES `t2` (`c1`) ON DELETE CASCADE
)
ENGINE=InnoDB DEFAULT CHARSET=latin1
alter table t1 drop foreign key c2_fk;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`c2` bigint(20) NOT NULL,
PRIMARY KEY (`c1`),
UNIQUE KEY `c2` (`c2`)
)
ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1, t2;
mysql-test/t/innodb.test
View file @
b974b776
...
...
@@ -2085,6 +2085,18 @@ connection default;
disconnect
a
;
disconnect
b
;
#
# Bug #14360: problem with intervals
#
create
table
t1
(
a
date
)
engine
=
innodb
;
create
table
t2
(
a
date
,
key
(
a
))
engine
=
innodb
;
insert
into
t1
values
(
'2005-10-01'
);
insert
into
t2
values
(
'2005-10-01'
);
select
*
from
t1
,
t2
where
t2
.
a
between
t1
.
a
-
interval
2
day
and
t1
.
a
+
interval
2
day
;
drop
table
t1
,
t2
;
#
# Test that cascading updates leading to duplicate keys give the correct
# error message (bug #9680)
...
...
@@ -2137,14 +2149,3 @@ alter table t1 drop foreign key c2_fk;
show
create
table
t1
;
#
drop
table
t1
,
t2
;
# Bug #14360: problem with intervals
#
create
table
t1
(
a
date
)
engine
=
innodb
;
create
table
t2
(
a
date
,
key
(
a
))
engine
=
innodb
;
insert
into
t1
values
(
'2005-10-01'
);
insert
into
t2
values
(
'2005-10-01'
);
select
*
from
t1
,
t2
where
t2
.
a
between
t1
.
a
-
interval
2
day
and
t1
.
a
+
interval
2
day
;
drop
table
t1
,
t2
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment