1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge bk-internal.mysql.com:/home/bk/mysql-5.1

into  mysql.com:/home/my/mysql-5.1


BUILD/SETUP.sh:
  Auto merged
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
  Auto merged
mysql-test/extra/rpl_tests/rpl_row_basic.test:
  Auto merged
mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/ctype_utf8.test:
  Auto merged
mysql-test/t/delayed.test:
  Auto merged
mysql-test/t/innodb.test:
  Auto merged
mysql-test/t/insert_select.test:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
mysql-test/t/ndb_index_unique.test:
  Auto merged
mysql-test/t/rpl_row_create_table.test:
  Auto merged
mysql-test/t/rpl_sp.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
mysql-test/t/type_binary.test:
  Auto merged
mysql-test/t/type_varchar.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/handler.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
mysql-test/r/rpl_sp.result:
  Manual merge
mysql-test/t/ndb_update.test:
  Manual merge
sql/share/errmsg.txt:
  Manual merge
This commit is contained in:
unknown
2007-01-22 19:18:22 +02:00
60 changed files with 283 additions and 251 deletions

View File

@ -393,24 +393,24 @@ DROP TABLE t1;
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
CREATE TABLE t2 (primary key (a)) select * from t1;
# This should give warning
drop table if exists t2;
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1;
# This should give warning
drop table if exists t2;
CREATE TABLE t2 (a int, b int, primary key (a));
BEGIN;
INSERT INTO t2 values(100,100);
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
SELECT * from t2;
ROLLBACK;
SELECT * from t2;
TRUNCATE table t2;
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
INSERT INTO t2 select * from t1;
SELECT * from t2;
drop table t2;
@ -418,19 +418,19 @@ drop table t2;
CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a));
BEGIN;
INSERT INTO t2 values(100,100);
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
SELECT * from t2;
COMMIT;
BEGIN;
INSERT INTO t2 values(101,101);
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
SELECT * from t2;
ROLLBACK;
SELECT * from t2;
TRUNCATE table t2;
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
INSERT INTO t2 select * from t1;
SELECT * from t2;
drop table t1,t2;

View File

@ -96,7 +96,7 @@ INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),
update t1 set parent_id=parent_id+100;
select * from t1 where parent_id=102;
update t1 set id=id+1000;
-- error 1062,1022
-- error ER_DUP_ENTRY_WITH_KEY_NAME,1022
update t1 set id=1024 where id=1009;
select * from t1;
update ignore t1 set id=id+1; # This will change all rows
@ -179,13 +179,13 @@ commit;
select n, "after commit" from t1;
commit;
insert into t1 values (5);
-- error 1062
-- error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t1 values (4);
commit;
select n, "after commit" from t1;
set autocommit=1;
insert into t1 values (6);
-- error 1062
-- error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t1 values (4);
select n from t1;
set autocommit=0;
@ -259,7 +259,7 @@ drop table t1;
eval CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=$engine_type;
insert into t1 values ('pippo', 12);
-- error 1062
-- error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t1 values ('pippo', 12); # Gives error
delete from t1;
delete from t1 where id = 'pippo';
@ -390,9 +390,9 @@ eval CREATE TABLE t1 (
insert into t1 (ggid,passwd) values ('test1','xxx');
insert into t1 (ggid,passwd) values ('test2','yyy');
-- error 1062
-- error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t1 (ggid,passwd) values ('test2','this will fail');
-- error 1062
-- error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t1 (ggid,id) values ('this will fail',1);
select * from t1 where ggid='test1';
@ -401,7 +401,7 @@ select * from t1 where id=2;
replace into t1 (ggid,id) values ('this will work',1);
replace into t1 (ggid,passwd) values ('test2','this will work');
-- error 1062
-- error ER_DUP_ENTRY_WITH_KEY_NAME
update t1 set id=100,ggid='test2' where id=1;
select * from t1;
select * from t1 where id=1;
@ -572,7 +572,7 @@ drop table t1;
eval create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=$engine_type;
insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
LOCK TABLES t1 WRITE;
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t1 values (99,1,2,'D'),(1,1,2,'D');
select id from t1;
select id from t1;
@ -583,7 +583,7 @@ eval create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 c
insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
LOCK TABLES t1 WRITE;
begin;
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t1 values (99,1,2,'D'),(1,1,2,'D');
select id from t1;
insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D');
@ -1513,7 +1513,7 @@ eval create table t1 (rowid int not null auto_increment, val int not null,primar
key (rowid), unique(val)) engine=$engine_type;
replace into t1 (val) values ('1'),('2');
replace into t1 (val) values ('1'),('2');
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t1 (val) values ('1'),('2');
select * from t1;
drop table t1;
@ -1528,7 +1528,7 @@ eval create table t1 (a int not null auto_increment primary key, val int) engine
insert into t1 (val) values (1);
update t1 set a=2 where a=1;
# We should get the following error because InnoDB does not update the counter
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t1 (val) values (1);
select * from t1;
drop table t1;
@ -2027,13 +2027,13 @@ eval create table t3 (s1 varchar(2) binary,primary key (s1)) engine=$engine_type
eval create table t4 (s1 char(2) binary,primary key (s1)) engine=$engine_type;
insert into t1 values (0x41),(0x4120),(0x4100);
-- error 1062
-- error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t2 values (0x41),(0x4120),(0x4100);
insert into t2 values (0x41),(0x4120);
-- error 1062
-- error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t3 values (0x41),(0x4120),(0x4100);
insert into t3 values (0x41),(0x4100);
-- error 1062
-- error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t4 values (0x41),(0x4120),(0x4100);
insert into t4 values (0x41),(0x4100);
select hex(s1) from t1;

View File

@ -193,7 +193,7 @@ prepare stmt1 from 'insert into t1 values(6, ? )';
execute stmt1 using @arg00;
select a,b from t1 where b = @arg00;
# the second insert fails, because the first column is primary key
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
execute stmt1 using @arg00;
set @arg00=NULL ;
prepare stmt1 from 'insert into t1 values(0, ? )';
@ -272,7 +272,7 @@ execute stmt1 using @arg00, @arg01;
select * from t1 order by a;
set @arg00=81 ;
set @arg01=1 ;
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
execute stmt1 using @arg00, @arg01;
## insert, autoincrement column and ' SELECT LAST_INSERT_ID() '

View File

@ -90,7 +90,7 @@ delete from t3 where t1_id = 1 and t2_id = 1;
select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc;
begin;
insert into t3 VALUES ( NULL, 1, 1, 2 );
-- error 1062
-- error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t3 VALUES ( NULL, 1, 1, 2 );
commit;
select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t2_id = t2.id and t1.id = 1 order by t1.a asc;

View File

@ -81,7 +81,7 @@ explain select count(*) from t1 where v between 'a' and 'a ';
--replace_column 9 #
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
alter table t1 add unique(v);
alter table t1 add key(v);
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a';
@ -179,17 +179,17 @@ drop table t1;
create table t1 (a char(10), unique (a));
insert into t1 values ('a ');
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t1 values ('a ');
alter table t1 modify a varchar(10);
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t1 values ('a '),('a '),('a '),('a ');
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t1 values ('a ');
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t1 values ('a ');
--error 1062
--error ER_DUP_ENTRY_WITH_KEY_NAME
insert into t1 values ('a ');
update t1 set a='a ' where a like 'a%';
select concat(a,'.') from t1;