mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge with 4.1
Makefile.am: Auto merged myisam/mi_create.c: Auto merged myisam/mi_open.c: Auto merged mysql-test/r/ctype_utf8.result: Auto merged mysys/thr_alarm.c: Auto merged VC++Files/sql/mysqld.dsp: Keep old client/mysqldump.c: Manual merge client/mysqltest.c: Automatic merge configure.in: Manual merge mysql-test/r/ctype_ucs.result: Auto merge mysql-test/r/func_str.result: Auto merge mysql-test/r/group_by.result: Auto merge mysql-test/r/insert_select.result: Auto merge mysql-test/r/insert_update.result: Auto merge mysql-test/r/lowercase_table2.result: Auto merge mysql-test/r/select.result: Manual merge mysql-test/r/variables.result: Auto merge mysql-test/t/ctype_ucs.test: Auto merge mysql-test/t/func_str.test: Auto merge mysql-test/t/group_by.test: Auto merge mysql-test/t/insert_select.test: Auto merge mysql-test/t/insert_update.test: Auto merge mysql-test/t/ndb_alter_table.test: Auto merge mysql-test/t/select.test: Auto merge mysql-test/t/variables.test: Auto merge mysys/my_access.c: Auto merge scripts/make_win_src_distribution.sh: Auto merge sql/field.cc: Manual merge sql/ha_ndbcluster.cc: Auto merge sql/handler.cc: Auto merge sql/item.cc: Auto merge sql/item.h: Manual merge sql/item_cmpfunc.h: Auto merge sql/item_strfunc.cc: Auto merge sql/item_strfunc.h: Auto merge sql/mysql_priv.h: manual merge sql/mysqld.cc: manual merge sql/opt_range.cc: manual merge sql/set_var.cc: Auto merge sql/sql_base.cc: manual merge Restore processing of ON DUPLICATE KEY UPDATE sql/sql_insert.cc: manual merge Restore processing of ON DUPLICATE KEY UPDATE Simplify mysql_prepare_insert by using local variable for select_lex and save old values just before they are changed sql/sql_parse.cc: Restore processing of ON DUPLICATE KEY UPDATE sql/sql_prepare.cc: New ON DUPLICATE KEY UPDATE handling sql/sql_select.cc: manual merge sql/sql_table.cc: auto merge sql/sql_yacc.yy: auto merge strings/ctype-ucs2.c: auto merge strings/ctype-utf8.c: auto merge
This commit is contained in:
@ -638,6 +638,17 @@ Warnings:
|
||||
Warning 1264 Out of range value adjusted for column 'Field1' at row 1
|
||||
DROP TABLE t1;
|
||||
SET NAMES latin1;
|
||||
CREATE TABLE t1 (
|
||||
a varchar(255) NOT NULL default '',
|
||||
KEY a (a)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=ucs2 COLLATE ucs2_general_ci;
|
||||
insert into t1 values (0x803d);
|
||||
insert into t1 values (0x005b);
|
||||
select hex(a) from t1;
|
||||
hex(a)
|
||||
005B
|
||||
803D
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
|
||||
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
|
||||
update t1 set b=a;
|
||||
|
@ -939,3 +939,14 @@ content msisdn
|
||||
ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми 1234567890
|
||||
11 g 1234567890
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (
|
||||
a varchar(255) NOT NULL default '',
|
||||
KEY a (a)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
|
||||
insert into t1 values (_utf8 0xe880bd);
|
||||
insert into t1 values (_utf8 0x5b);
|
||||
select hex(a) from t1;
|
||||
hex(a)
|
||||
5B
|
||||
E880BD
|
||||
drop table t1;
|
||||
|
@ -128,18 +128,12 @@ Error 1108 Incorrect parameters to procedure 'des_encrypt'
|
||||
select des_encrypt(NULL);
|
||||
des_encrypt(NULL)
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1108 Incorrect parameters to procedure 'des_encrypt'
|
||||
select des_encrypt(NULL, 10);
|
||||
des_encrypt(NULL, 10)
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1108 Incorrect parameters to procedure 'des_encrypt'
|
||||
select des_encrypt(NULL, NULL);
|
||||
des_encrypt(NULL, NULL)
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1108 Incorrect parameters to procedure 'des_encrypt'
|
||||
select des_encrypt(10, NULL);
|
||||
des_encrypt(10, NULL)
|
||||
NULL
|
||||
@ -156,18 +150,12 @@ hello
|
||||
select des_decrypt(NULL);
|
||||
des_decrypt(NULL)
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1108 Incorrect parameters to procedure 'des_decrypt'
|
||||
select des_decrypt(NULL, 10);
|
||||
des_decrypt(NULL, 10)
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1108 Incorrect parameters to procedure 'des_decrypt'
|
||||
select des_decrypt(NULL, NULL);
|
||||
des_decrypt(NULL, NULL)
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1108 Incorrect parameters to procedure 'des_decrypt'
|
||||
select des_decrypt(10, NULL);
|
||||
des_decrypt(10, NULL)
|
||||
10
|
||||
|
@ -23,6 +23,11 @@ des_encrypt("test", NULL)
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||
select des_encrypt(NULL, NULL);
|
||||
des_encrypt(NULL, NULL)
|
||||
NULL
|
||||
Warnings:
|
||||
Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
|
||||
select des_decrypt("test", 'anotherkeystr');
|
||||
des_decrypt("test", 'anotherkeystr')
|
||||
NULL
|
||||
|
@ -811,3 +811,53 @@ SELECT * FROM t1, t2 WHERE num=substring(str from 1 for 6);
|
||||
str num
|
||||
notnumber 0
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1(
|
||||
id int(11) NOT NULL auto_increment,
|
||||
pc int(11) NOT NULL default '0',
|
||||
title varchar(20) default NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
INSERT INTO t1 VALUES
|
||||
(1, 0, 'Main'),
|
||||
(2, 1, 'Toys'),
|
||||
(3, 1, 'Games');
|
||||
SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
|
||||
FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
|
||||
LEFT JOIN t1 AS t3 ON t2.pc=t3.id;
|
||||
id col1
|
||||
1 Main
|
||||
2 Main->Toys
|
||||
3 Main->Games
|
||||
SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
|
||||
FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
|
||||
LEFT JOIN t1 AS t3 ON t2.pc=t3.id
|
||||
WHERE CONCAT_WS('->', t3.title, t2.title, t1.title) LIKE '%Toys%';
|
||||
id col1
|
||||
2 Main->Toys
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(
|
||||
trackid int(10) unsigned NOT NULL auto_increment,
|
||||
trackname varchar(100) NOT NULL default '',
|
||||
PRIMARY KEY (trackid)
|
||||
);
|
||||
CREATE TABLE t2(
|
||||
artistid int(10) unsigned NOT NULL auto_increment,
|
||||
artistname varchar(100) NOT NULL default '',
|
||||
PRIMARY KEY (artistid)
|
||||
);
|
||||
CREATE TABLE t3(
|
||||
trackid int(10) unsigned NOT NULL,
|
||||
artistid int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (trackid,artistid)
|
||||
);
|
||||
INSERT INTO t1 VALUES (1, 'April In Paris'), (2, 'Autumn In New York');
|
||||
INSERT INTO t2 VALUES (1, 'Vernon Duke');
|
||||
INSERT INTO t3 VALUES (1,1);
|
||||
SELECT CONCAT_WS(' ', trackname, artistname) trackname, artistname
|
||||
FROM t1 LEFT JOIN t3 ON t1.trackid=t3.trackid
|
||||
LEFT JOIN t2 ON t2.artistid=t3.artistid
|
||||
WHERE CONCAT_WS(' ', trackname, artistname) LIKE '%In%';
|
||||
trackname artistname
|
||||
April In Paris Vernon Duke Vernon Duke
|
||||
Autumn In New York NULL
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
@ -721,6 +721,12 @@ SELECT hostname, COUNT(DISTINCT user_id) as no FROM t1
|
||||
WHERE hostname LIKE '%aol%'
|
||||
GROUP BY hostname;
|
||||
hostname no
|
||||
CREATE TABLE t1 (n int);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
SELECT n+1 AS n FROM t1 GROUP BY n;
|
||||
n
|
||||
2
|
||||
DROP TABLE t1;
|
||||
cache-dtc-af05.proxy.aol.com 1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
|
@ -1,4 +1,4 @@
|
||||
drop table if exists t1,t2;
|
||||
drop table if exists t1,t2,t3;
|
||||
create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLINT UNSIGNED NOT NULL);
|
||||
insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12);
|
||||
create table t2 (payoutID SMALLINT UNSIGNED NOT NULL PRIMARY KEY);
|
||||
@ -636,16 +636,35 @@ ff1 ff2
|
||||
drop table t1, t2;
|
||||
create table t1 (a int unique);
|
||||
create table t2 (a int, b int);
|
||||
create table t3 (c int, d int);
|
||||
insert into t1 values (1),(2);
|
||||
insert into t2 values (1,2);
|
||||
insert into t3 values (1,6),(3,7);
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
insert into t1 select t2.a from t2 on duplicate key update a= a + t2.b;
|
||||
insert into t1 select a from t2 on duplicate key update a= t1.a + t2.b;
|
||||
select * from t1;
|
||||
a
|
||||
2
|
||||
3
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
insert into t1 select a+1 from t2 on duplicate key update t1.a= t1.a + t2.b+1;
|
||||
select * from t1;
|
||||
a
|
||||
3
|
||||
5
|
||||
insert into t1 select t3.c from t3 on duplicate key update a= a + t3.d;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
5
|
||||
10
|
||||
insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= a + 10;
|
||||
insert into t1 select t2.a from t2 on duplicate key update a= a + t2.b;
|
||||
ERROR 23000: Column 'a' in field list is ambiguous
|
||||
insert into t1 select t2.a from t2 on duplicate key update t2.a= a + t2.b;
|
||||
ERROR 42S02: Unknown table 't2' in field list
|
||||
insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b;
|
||||
ERROR 42S02: Unknown table 't2' in field list
|
||||
drop table t1,t2,t3;
|
||||
|
@ -143,7 +143,7 @@ INSERT t1 VALUES (1,2,10), (3,4,20);
|
||||
CREATE TABLE t2 (a INT, b INT, c INT, d INT);
|
||||
INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1);
|
||||
INSERT t2 VALUES (2,1,11,2), (7,4,40,2);
|
||||
INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100;
|
||||
INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=t1.c+100;
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 2 10
|
||||
@ -158,6 +158,8 @@ a b c
|
||||
5 0 30
|
||||
8 9 60
|
||||
INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a);
|
||||
ERROR 23000: Column 'c' in field list is ambiguous
|
||||
INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=t1.c+VALUES(t1.a);
|
||||
SELECT *, VALUES(a) FROM t1;
|
||||
a b c VALUES(a)
|
||||
1 2 10 NULL
|
||||
@ -174,7 +176,7 @@ select * from t1;
|
||||
a
|
||||
1
|
||||
2
|
||||
insert ignore into t1 select a from t1 on duplicate key update a=a+1 ;
|
||||
insert ignore into t1 select a from t1 as t2 on duplicate key update a=t1.a+1 ;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
@ -185,5 +187,7 @@ a
|
||||
2
|
||||
3
|
||||
insert into t1 select a from t1 on duplicate key update a=a+1 ;
|
||||
ERROR 23000: Duplicate entry '3' for key 1
|
||||
ERROR 23000: Column 'a' in field list is ambiguous
|
||||
insert ignore into t1 select a from t1 on duplicate key update a=t1.a+1 ;
|
||||
ERROR 23000: Column 't1.a' in field list is ambiguous
|
||||
drop table t1;
|
||||
|
@ -1,6 +1,7 @@
|
||||
DROP TABLE IF EXISTS t1,t2,t3;
|
||||
DROP TABLE IF EXISTS t1,t2,t3,t2aA,t1Aa;
|
||||
DROP DATABASE IF EXISTS `TEST_$1`;
|
||||
DROP DATABASE IF EXISTS `test_$1`;
|
||||
DROP DATABASE mysqltest_LC2;
|
||||
CREATE TABLE T1 (a int);
|
||||
INSERT INTO T1 VALUES (1);
|
||||
SHOW TABLES LIKE "T1";
|
||||
|
@ -2681,6 +2681,15 @@ SELECT COUNT(*) FROM t1 WHERE
|
||||
AND FK_firma_id = 2;
|
||||
COUNT(*)
|
||||
0
|
||||
CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL);
|
||||
CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL);
|
||||
INSERT INTO `t2` VALUES (0,'READ');
|
||||
CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL);
|
||||
INSERT INTO `t3` VALUES (1,'fs');
|
||||
select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0);
|
||||
id name gid uid ident level
|
||||
1 fs NULL NULL 0 READ
|
||||
drop table t1,t2,t3;
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int);
|
||||
CREATE TABLE t2 (a int);
|
||||
|
@ -504,10 +504,10 @@ t1 CREATE TABLE `t1` (
|
||||
`c4` double default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8;
|
||||
SET GLOBAL MYISAM_DATA_POINTER_SIZE= 7;
|
||||
SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE';
|
||||
Variable_name Value
|
||||
myisam_data_pointer_size 8
|
||||
myisam_data_pointer_size 7
|
||||
SET GLOBAL table_cache=-1;
|
||||
SHOW VARIABLES LIKE 'table_cache';
|
||||
Variable_name Value
|
||||
|
@ -407,6 +407,18 @@ INSERT INTO t1 VALUES ('-1');
|
||||
DROP TABLE t1;
|
||||
SET NAMES latin1;
|
||||
|
||||
#
|
||||
# Bug#9557 MyISAM utf8 table crash
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
a varchar(255) NOT NULL default '',
|
||||
KEY a (a)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=ucs2 COLLATE ucs2_general_ci;
|
||||
insert into t1 values (0x803d);
|
||||
insert into t1 values (0x005b);
|
||||
select hex(a) from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Conversion from an UCS2 string to a decimal column
|
||||
#
|
||||
|
@ -788,3 +788,15 @@ INSERT INTO t2 VALUES ('1234567890',2,'2005-05-24 13:53:25');
|
||||
SELECT content, t2.msisdn FROM t1, t2 WHERE t1.msisdn = '1234567890';
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
#
|
||||
# Bug#9557 MyISAM utf8 table crash
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
a varchar(255) NOT NULL default '',
|
||||
KEY a (a)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
|
||||
insert into t1 values (_utf8 0xe880bd);
|
||||
insert into t1 values (_utf8 0x5b);
|
||||
select hex(a) from t1;
|
||||
drop table t1;
|
||||
|
@ -9,6 +9,7 @@ select des_encrypt("test", 1);
|
||||
select des_encrypt("test", 9);
|
||||
select des_encrypt("test", 100);
|
||||
select des_encrypt("test", NULL);
|
||||
select des_encrypt(NULL, NULL);
|
||||
select des_decrypt("test", 'anotherkeystr');
|
||||
select des_decrypt(1, 1);
|
||||
select des_decrypt(des_encrypt("test", 'thekey'));
|
||||
|
@ -543,3 +543,59 @@ SELECT * FROM t1, t2 WHERE num=str;
|
||||
SELECT * FROM t1, t2 WHERE num=substring(str from 1 for 6);
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
#
|
||||
# Bug #11469: NOT NULL optimization wrongly used for arguments of CONCAT_WS
|
||||
#
|
||||
|
||||
CREATE TABLE t1(
|
||||
id int(11) NOT NULL auto_increment,
|
||||
pc int(11) NOT NULL default '0',
|
||||
title varchar(20) default NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
INSERT INTO t1 VALUES
|
||||
(1, 0, 'Main'),
|
||||
(2, 1, 'Toys'),
|
||||
(3, 1, 'Games');
|
||||
|
||||
SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
|
||||
FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
|
||||
LEFT JOIN t1 AS t3 ON t2.pc=t3.id;
|
||||
SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
|
||||
FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
|
||||
LEFT JOIN t1 AS t3 ON t2.pc=t3.id
|
||||
WHERE CONCAT_WS('->', t3.title, t2.title, t1.title) LIKE '%Toys%';
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
CREATE TABLE t1(
|
||||
trackid int(10) unsigned NOT NULL auto_increment,
|
||||
trackname varchar(100) NOT NULL default '',
|
||||
PRIMARY KEY (trackid)
|
||||
);
|
||||
|
||||
CREATE TABLE t2(
|
||||
artistid int(10) unsigned NOT NULL auto_increment,
|
||||
artistname varchar(100) NOT NULL default '',
|
||||
PRIMARY KEY (artistid)
|
||||
);
|
||||
|
||||
CREATE TABLE t3(
|
||||
trackid int(10) unsigned NOT NULL,
|
||||
artistid int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (trackid,artistid)
|
||||
);
|
||||
|
||||
INSERT INTO t1 VALUES (1, 'April In Paris'), (2, 'Autumn In New York');
|
||||
INSERT INTO t2 VALUES (1, 'Vernon Duke');
|
||||
INSERT INTO t3 VALUES (1,1);
|
||||
|
||||
SELECT CONCAT_WS(' ', trackname, artistname) trackname, artistname
|
||||
FROM t1 LEFT JOIN t3 ON t1.trackid=t3.trackid
|
||||
LEFT JOIN t2 ON t2.artistid=t3.artistid
|
||||
WHERE CONCAT_WS(' ', trackname, artistname) LIKE '%In%';
|
||||
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
@ -543,6 +543,18 @@ SELECT hostname, COUNT(DISTINCT user_id) as no FROM t1
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
||||
#
|
||||
# Test for bug #11414: crash on Windows for a simple GROUP BY query
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (n int);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
SELECT n+1 AS n FROM t1 GROUP BY n;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
# Test for bug #8614: GROUP BY 'const' with DISTINCT
|
||||
#
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
drop table if exists t1,t2,t3;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLINT UNSIGNED NOT NULL);
|
||||
@ -180,10 +180,24 @@ drop table t1, t2;
|
||||
#
|
||||
create table t1 (a int unique);
|
||||
create table t2 (a int, b int);
|
||||
create table t3 (c int, d int);
|
||||
insert into t1 values (1),(2);
|
||||
insert into t2 values (1,2);
|
||||
insert into t3 values (1,6),(3,7);
|
||||
select * from t1;
|
||||
insert into t1 select a from t2 on duplicate key update a= t1.a + t2.b;
|
||||
select * from t1;
|
||||
insert into t1 select a+1 from t2 on duplicate key update t1.a= t1.a + t2.b+1;
|
||||
select * from t1;
|
||||
insert into t1 select t3.c from t3 on duplicate key update a= a + t3.d;
|
||||
select * from t1;
|
||||
insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= a + 10;
|
||||
|
||||
#Some error cases
|
||||
--error 1052
|
||||
insert into t1 select t2.a from t2 on duplicate key update a= a + t2.b;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
--error 1109
|
||||
insert into t1 select t2.a from t2 on duplicate key update t2.a= a + t2.b;
|
||||
--error 1109
|
||||
insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b;
|
||||
drop table t1,t2,t3;
|
||||
|
@ -72,11 +72,13 @@ CREATE TABLE t2 (a INT, b INT, c INT, d INT);
|
||||
# column names deliberately clash with columns in t1 (Bug#8147)
|
||||
INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1);
|
||||
INSERT t2 VALUES (2,1,11,2), (7,4,40,2);
|
||||
INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100;
|
||||
INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=t1.c+100;
|
||||
SELECT * FROM t1;
|
||||
INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0;
|
||||
SELECT * FROM t1;
|
||||
--error 1052
|
||||
INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a);
|
||||
INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=t1.c+VALUES(t1.a);
|
||||
SELECT *, VALUES(a) FROM t1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
@ -89,10 +91,12 @@ create table t1 (a int not null unique) engine=myisam;
|
||||
insert into t1 values (1),(2);
|
||||
insert ignore into t1 select 1 on duplicate key update a=2;
|
||||
select * from t1;
|
||||
insert ignore into t1 select a from t1 on duplicate key update a=a+1 ;
|
||||
insert ignore into t1 select a from t1 as t2 on duplicate key update a=t1.a+1 ;
|
||||
select * from t1;
|
||||
insert into t1 select 1 on duplicate key update a=2;
|
||||
select * from t1;
|
||||
--error 1062
|
||||
--error 1052
|
||||
insert into t1 select a from t1 on duplicate key update a=a+1 ;
|
||||
--error 1052
|
||||
insert ignore into t1 select a from t1 on duplicate key update a=t1.a+1 ;
|
||||
drop table t1;
|
||||
|
@ -10,9 +10,10 @@ show variables like "lower_case_table_names";
|
||||
enable_query_log;
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1,t2,t3;
|
||||
DROP TABLE IF EXISTS t1,t2,t3,t2aA,t1Aa;
|
||||
DROP DATABASE IF EXISTS `TEST_$1`;
|
||||
DROP DATABASE IF EXISTS `test_$1`;
|
||||
DROP DATABASE mysqltest_LC2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE T1 (a int);
|
||||
|
@ -7,6 +7,13 @@ DROP TABLE IF EXISTS t1;
|
||||
drop database if exists mysqltest;
|
||||
--enable_warnings
|
||||
|
||||
connect (con1,localhost,root,,test);
|
||||
connect (con2,localhost,root,,test);
|
||||
|
||||
connection con2;
|
||||
-- sleep 2
|
||||
connection con1;
|
||||
|
||||
#
|
||||
# Basic test to show that the ALTER TABLE
|
||||
# is working
|
||||
@ -92,10 +99,6 @@ CREATE TABLE t1 (
|
||||
|
||||
INSERT INTO t1 VALUES (9410,9412);
|
||||
|
||||
connect (con1,localhost,,,test);
|
||||
connect (con2,localhost,,,test);
|
||||
|
||||
connection con1;
|
||||
ALTER TABLE t1 ADD COLUMN c int not null;
|
||||
select * from t1 order by a;
|
||||
|
||||
|
@ -2007,6 +2007,21 @@ CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b));
|
||||
INSERT INTO t1 VALUES (0x8000000000000000);
|
||||
SELECT b FROM t1 WHERE b=0x8000000000000000;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# IN with outer join condition (BUG#9393)
|
||||
#
|
||||
CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL);
|
||||
|
||||
CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL);
|
||||
INSERT INTO `t2` VALUES (0,'READ');
|
||||
|
||||
CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL);
|
||||
INSERT INTO `t3` VALUES (1,'fs');
|
||||
|
||||
select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0);
|
||||
|
||||
drop table t1,t2,t3;
|
||||
# Test for bug #6474
|
||||
#
|
||||
|
||||
|
@ -373,9 +373,13 @@ drop table t1;
|
||||
|
||||
#
|
||||
# Bug #6993: myisam_data_pointer_size
|
||||
# Wrong bug report, data pointer size must be restricted to 7,
|
||||
# setting to 8 will not work on all computers, myisamchk and
|
||||
# the server may see a wrong value, such as 0 or negative number
|
||||
# if 8 bytes is set.
|
||||
#
|
||||
|
||||
SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8;
|
||||
SET GLOBAL MYISAM_DATA_POINTER_SIZE= 7;
|
||||
SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE';
|
||||
|
||||
#
|
||||
|
Reference in New Issue
Block a user