mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-bug_qc-4.1
This commit is contained in:
@ -630,3 +630,14 @@ Warnings:
|
||||
Warning 1265 Data truncated 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;
|
||||
|
@ -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;
|
||||
|
@ -789,3 +789,64 @@ field(0,NULL,1,0) field("",NULL,"bar","") field(0.0,NULL,1.0,0.0)
|
||||
select field(NULL,1,2,NULL), field(NULL,1,2,0);
|
||||
field(NULL,1,2,NULL) field(NULL,1,2,0)
|
||||
0 0
|
||||
CREATE TABLE t1 (str varchar(20) PRIMARY KEY);
|
||||
CREATE TABLE t2 (num int primary key);
|
||||
INSERT INTO t1 VALUES ('notnumber');
|
||||
INSERT INTO t2 VALUES (0), (1);
|
||||
SELECT * FROM t1, t2 WHERE num=str;
|
||||
str num
|
||||
notnumber 0
|
||||
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;
|
||||
|
@ -751,3 +751,9 @@ COUNT(DISTINCT(t1.id)) err_comment
|
||||
1 NULL
|
||||
1 a problem
|
||||
DROP TABLE t1, t2;
|
||||
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;
|
||||
|
@ -2515,3 +2515,12 @@ SELECT b FROM t1 WHERE b=0x8000000000000000;
|
||||
b
|
||||
9223372036854775808
|
||||
DROP TABLE t1;
|
||||
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;
|
||||
|
@ -482,10 +482,10 @@ t1 CREATE TABLE `t1` (
|
||||
`c3` longtext
|
||||
) 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
|
||||
|
@ -404,3 +404,15 @@ CREATE TABLE t1 (Field1 int(10) unsigned default '0');
|
||||
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;
|
||||
|
@ -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;
|
||||
|
@ -527,3 +527,73 @@ DROP TABLE t1, t2;
|
||||
#
|
||||
select field(0,NULL,1,0), field("",NULL,"bar",""), field(0.0,NULL,1.0,0.0);
|
||||
select field(NULL,1,2,NULL), field(NULL,1,2,0);
|
||||
|
||||
#
|
||||
# Bug #10124: access by integer index with a string key that is not a number
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (str varchar(20) PRIMARY KEY);
|
||||
CREATE TABLE t2 (num int primary key);
|
||||
INSERT INTO t1 VALUES ('notnumber');
|
||||
INSERT INTO t2 VALUES (0), (1);
|
||||
|
||||
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;
|
||||
|
@ -580,3 +580,15 @@ SELECT COUNT(DISTINCT(t1.id)), LEFT(err_comment, 256) AS err_comment
|
||||
FROM t1 LEFT JOIN t2 ON t1.id=t2.id GROUP BY err_comment;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
#
|
||||
# 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;
|
||||
|
||||
|
@ -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
|
||||
@ -88,10 +95,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;
|
||||
|
||||
|
@ -2060,3 +2060,18 @@ 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;
|
||||
|
@ -363,9 +363,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