mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Merge stella.local:/home2/mydev/mysql-5.1-amain
into stella.local:/home2/mydev/mysql-5.1-axmrg
This commit is contained in:
@@ -8,6 +8,10 @@ drop table if exists t3;
|
|||||||
drop table if exists t4;
|
drop table if exists t4;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
|
SET @test_character_set= 'cp932';
|
||||||
|
SET @test_collation= 'cp932_japanese_ci';
|
||||||
|
-- source include/ctype_common.inc
|
||||||
|
|
||||||
set names cp932;
|
set names cp932;
|
||||||
set character_set_database = cp932;
|
set character_set_database = cp932;
|
||||||
|
|
||||||
|
@@ -53,11 +53,13 @@ DROP TABLE t1;
|
|||||||
|
|
||||||
#
|
#
|
||||||
# Bug #31070: crash during conversion of charsets
|
# Bug #31070: crash during conversion of charsets
|
||||||
|
# Bug #32726: crash with cast in order by clause and cp932 charset
|
||||||
#
|
#
|
||||||
create table t1 (a set('a') not null);
|
create table t1 (a set('a') not null);
|
||||||
insert into t1 values (),();
|
insert into t1 values (),();
|
||||||
select cast(a as char(1)) from t1;
|
select cast(a as char(1)) from t1;
|
||||||
select a sounds like a from t1;
|
select a sounds like a from t1;
|
||||||
|
select 1 from t1 order by cast(a as char(1));
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
DROP DATABASE d1;
|
DROP DATABASE d1;
|
||||||
|
@@ -12687,3 +12687,10 @@ CREATE TABLE t1(a VARCHAR(510)) ENGINE = ARCHIVE;
|
|||||||
INSERT INTO t1(a) VALUES ('');
|
INSERT INTO t1(a) VALUES ('');
|
||||||
SELECT * FROM t1 ORDER BY a;
|
SELECT * FROM t1 ORDER BY a;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1(a INT NOT NULL AUTO_INCREMENT, b BLOB, KEY(a)) ENGINE=archive;
|
||||||
|
INSERT INTO t1 VALUES (NULL, NULL),(NULL, NULL);
|
||||||
|
FLUSH TABLE t1;
|
||||||
|
SELECT * FROM t1 ORDER BY a;
|
||||||
|
a b
|
||||||
|
1 NULL
|
||||||
|
2 NULL
|
||||||
|
@@ -5364,13 +5364,19 @@ BIN(a)
|
|||||||
0
|
0
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1(a enum('foo','bar') default null) engine=csv;
|
create table t1(a enum('foo','bar') default null) engine=csv;
|
||||||
ERROR HY000: Can't create table 'test.t1' (errno: -1)
|
ERROR 42000: The storage engine for the table doesn't support nullable columns
|
||||||
create table t1(a enum('foo','bar') default 'foo') engine=csv;
|
create table t1(a enum('foo','bar') default 'foo') engine=csv;
|
||||||
ERROR HY000: Can't create table 'test.t1' (errno: -1)
|
ERROR 42000: The storage engine for the table doesn't support nullable columns
|
||||||
create table t1(a enum('foo','bar') default 'foo' not null) engine=csv;
|
create table t1(a enum('foo','bar') default 'foo' not null) engine=csv;
|
||||||
insert into t1 values();
|
insert into t1 values();
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
foo
|
foo
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
CREATE TABLE t1(a INT) ENGINE=CSV;
|
||||||
|
ERROR 42000: The storage engine for the table doesn't support nullable columns
|
||||||
|
SHOW WARNINGS;
|
||||||
|
Level Code Message
|
||||||
|
Error 1178 The storage engine for the table doesn't support nullable columns
|
||||||
|
Error 1005 Can't create table 'test.t1' (errno: 138)
|
||||||
End of 5.1 tests
|
End of 5.1 tests
|
||||||
|
@@ -64,6 +64,10 @@ select a sounds like a from t1;
|
|||||||
a sounds like a
|
a sounds like a
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
|
select 1 from t1 order by cast(a as char(1));
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
DROP DATABASE d1;
|
DROP DATABASE d1;
|
||||||
USE test;
|
USE test;
|
||||||
|
@@ -64,6 +64,10 @@ select a sounds like a from t1;
|
|||||||
a sounds like a
|
a sounds like a
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
|
select 1 from t1 order by cast(a as char(1));
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
DROP DATABASE d1;
|
DROP DATABASE d1;
|
||||||
USE test;
|
USE test;
|
||||||
|
@@ -64,6 +64,10 @@ select a sounds like a from t1;
|
|||||||
a sounds like a
|
a sounds like a
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
|
select 1 from t1 order by cast(a as char(1));
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
DROP DATABASE d1;
|
DROP DATABASE d1;
|
||||||
USE test;
|
USE test;
|
||||||
|
@@ -64,6 +64,10 @@ select a sounds like a from t1;
|
|||||||
a sounds like a
|
a sounds like a
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
|
select 1 from t1 order by cast(a as char(1));
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
DROP DATABASE d1;
|
DROP DATABASE d1;
|
||||||
USE test;
|
USE test;
|
||||||
|
@@ -2599,6 +2599,10 @@ select a sounds like a from t1;
|
|||||||
a sounds like a
|
a sounds like a
|
||||||
1
|
1
|
||||||
1
|
1
|
||||||
|
select 1 from t1 order by cast(a as char(1));
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
drop table t1;
|
drop table t1;
|
||||||
DROP DATABASE d1;
|
DROP DATABASE d1;
|
||||||
USE test;
|
USE test;
|
||||||
|
@@ -250,6 +250,11 @@ SELECT HEX(a) FROM t1;
|
|||||||
HEX(a)
|
HEX(a)
|
||||||
1
|
1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (a INT);
|
||||||
|
INSERT DELAYED INTO t1 SET b= b();
|
||||||
|
ERROR 42S22: Unknown column 'b' in 'field list'
|
||||||
|
DROP TABLE t1;
|
||||||
|
End of 5.0 tests
|
||||||
DROP TABLE IF EXISTS t1,t2;
|
DROP TABLE IF EXISTS t1,t2;
|
||||||
SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
|
SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
|
||||||
CREATE TABLE `t1` (
|
CREATE TABLE `t1` (
|
||||||
@@ -279,3 +284,4 @@ ERROR 22007: Incorrect date value: '0000-00-00' for column 'f1' at row 1
|
|||||||
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
|
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
|
||||||
ERROR 22007: Incorrect date value: '2007-00-00' for column 'f1' at row 1
|
ERROR 22007: Incorrect date value: '2007-00-00' for column 'f1' at row 1
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
|
End of 5.1 tests
|
||||||
|
@@ -78,10 +78,10 @@ FROM INFORMATION_SCHEMA.EVENTS
|
|||||||
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
|
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
|
||||||
IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR')
|
IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR')
|
||||||
OK
|
OK
|
||||||
SELECT IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR')
|
SELECT IF(LAST_EXECUTED-ENDS <= 0, 'OK', 'ERROR')
|
||||||
FROM INFORMATION_SCHEMA.EVENTS
|
FROM INFORMATION_SCHEMA.EVENTS
|
||||||
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
|
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
|
||||||
IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR')
|
IF(LAST_EXECUTED-ENDS <= 0, 'OK', 'ERROR')
|
||||||
OK
|
OK
|
||||||
"Already dropped because ended. Therefore an error."
|
"Already dropped because ended. Therefore an error."
|
||||||
DROP EVENT event_3;
|
DROP EVENT event_3;
|
||||||
|
@@ -218,6 +218,13 @@ select min(a) from t1 group by inet_ntoa(a);
|
|||||||
min(a)
|
min(a)
|
||||||
-2
|
-2
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
CREATE TABLE t1(a INT);
|
||||||
|
INSERT INTO t1 VALUES (), (), ();
|
||||||
|
SELECT NAME_CONST(a, '1') FROM t1;
|
||||||
|
ERROR HY000: Incorrect arguments to NAME_CONST
|
||||||
|
SET INSERT_ID= NAME_CONST(a, a);
|
||||||
|
ERROR HY000: Incorrect arguments to NAME_CONST
|
||||||
|
DROP TABLE t1;
|
||||||
End of 5.0 tests
|
End of 5.0 tests
|
||||||
select connection_id() > 0;
|
select connection_id() > 0;
|
||||||
connection_id() > 0
|
connection_id() > 0
|
||||||
|
37
mysql-test/r/merge_innodb.result
Normal file
37
mysql-test/r/merge_innodb.result
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
DROP TABLE IF EXISTS t1, t2, t3, t4, t5;
|
||||||
|
CREATE TABLE t1 (c1 varchar(100)) ENGINE=MyISAM;
|
||||||
|
CREATE TABLE t2 (c1 varchar(100)) ENGINE=MyISAM;
|
||||||
|
CREATE TABLE t3 (c1 varchar(100)) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 VALUES ('Ann'), ('Alice');
|
||||||
|
INSERT INTO t2 VALUES ('Bob'), ('Brian');
|
||||||
|
INSERT INTO t3 VALUES ('Chris'), ('Charlie');
|
||||||
|
CREATE TABLE t4 (c1 varchar(100)) ENGINE=MRG_MYISAM UNION=(t1,t2)
|
||||||
|
INSERT_METHOD=LAST;
|
||||||
|
CREATE TABLE t5 (c1 varchar(100)) ENGINE=MRG_MYISAM UNION=(t1,t3)
|
||||||
|
INSERT_METHOD=LAST;
|
||||||
|
SELECT * FROM t5;
|
||||||
|
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
|
||||||
|
SELECT * FROM t4;
|
||||||
|
c1
|
||||||
|
Ann
|
||||||
|
Alice
|
||||||
|
Bob
|
||||||
|
Brian
|
||||||
|
ALTER TABLE t2 ENGINE=InnoDB;
|
||||||
|
SELECT * FROM t4;
|
||||||
|
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
|
||||||
|
DELETE FROM t2 LIMIT 1;
|
||||||
|
SELECT * FROM t4;
|
||||||
|
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
|
||||||
|
INSERT INTO t4 VALUES ('Beware');
|
||||||
|
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
|
||||||
|
SELECT * FROM t4;
|
||||||
|
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
|
||||||
|
SELECT * FROM t2;
|
||||||
|
c1
|
||||||
|
Brian
|
||||||
|
SELECT * FROM t1;
|
||||||
|
c1
|
||||||
|
Ann
|
||||||
|
Alice
|
||||||
|
DROP TABLE t1, t2, t3, t4, t5;
|
@@ -1307,4 +1307,51 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
|||||||
ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED;
|
ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED;
|
||||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTENDED' at line 1
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXTENDED' at line 1
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (s1 BIGINT UNSIGNED)
|
||||||
|
PARTITION BY RANGE (s1) (
|
||||||
|
PARTITION p0 VALUES LESS THAN (0),
|
||||||
|
PARTITION p1 VALUES LESS THAN (1),
|
||||||
|
PARTITION p2 VALUES LESS THAN (18446744073709551615)
|
||||||
|
);
|
||||||
|
INSERT INTO t1 VALUES (0), (18446744073709551614);
|
||||||
|
INSERT INTO t1 VALUES (18446744073709551615);
|
||||||
|
ERROR HY000: Table has no partition for value 18446744073709551615
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (s1 BIGINT UNSIGNED)
|
||||||
|
PARTITION BY RANGE (s1) (
|
||||||
|
PARTITION p0 VALUES LESS THAN (0),
|
||||||
|
PARTITION p1 VALUES LESS THAN (1),
|
||||||
|
PARTITION p2 VALUES LESS THAN (18446744073709551614),
|
||||||
|
PARTITION p3 VALUES LESS THAN MAXVALUE
|
||||||
|
);
|
||||||
|
INSERT INTO t1 VALUES (-1), (0), (18446744073709551613),
|
||||||
|
(18446744073709551614), (18446744073709551615);
|
||||||
|
Warnings:
|
||||||
|
Warning 1264 Out of range value for column 's1' at row 1
|
||||||
|
SELECT * FROM t1;
|
||||||
|
s1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
18446744073709551613
|
||||||
|
18446744073709551614
|
||||||
|
18446744073709551615
|
||||||
|
SELECT * FROM t1 WHERE s1 = 0;
|
||||||
|
s1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
SELECT * FROM t1 WHERE s1 = 18446744073709551614;
|
||||||
|
s1
|
||||||
|
18446744073709551614
|
||||||
|
SELECT * FROM t1 WHERE s1 = 18446744073709551615;
|
||||||
|
s1
|
||||||
|
18446744073709551615
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (s1 BIGINT UNSIGNED)
|
||||||
|
PARTITION BY RANGE (s1) (
|
||||||
|
PARTITION p0 VALUES LESS THAN (0),
|
||||||
|
PARTITION p1 VALUES LESS THAN (1),
|
||||||
|
PARTITION p2 VALUES LESS THAN (18446744073709551615),
|
||||||
|
PARTITION p3 VALUES LESS THAN MAXVALUE
|
||||||
|
);
|
||||||
|
DROP TABLE t1;
|
||||||
End of 5.1 tests
|
End of 5.1 tests
|
||||||
|
@@ -1,4 +1,16 @@
|
|||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
|
CREATE TABLE t1 (c1 INT)
|
||||||
|
PARTITION BY HASH (c1)
|
||||||
|
PARTITIONS 15;
|
||||||
|
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
|
||||||
|
ALTER TABLE t1 COALESCE PARTITION 13;
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 INT)
|
||||||
|
PARTITION BY LINEAR HASH (c1)
|
||||||
|
PARTITIONS 5;
|
||||||
|
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
|
||||||
|
ALTER TABLE t1 COALESCE PARTITION 3;
|
||||||
|
DROP TABLE t1;
|
||||||
create table t1 (a int unsigned)
|
create table t1 (a int unsigned)
|
||||||
partition by hash(a div 2)
|
partition by hash(a div 2)
|
||||||
partitions 4;
|
partitions 4;
|
||||||
|
@@ -2,6 +2,80 @@ drop table if exists t1;
|
|||||||
drop table if exists t2;
|
drop table if exists t2;
|
||||||
drop table if exists t3;
|
drop table if exists t3;
|
||||||
drop table if exists t4;
|
drop table if exists t4;
|
||||||
|
SET @test_character_set= 'cp932';
|
||||||
|
SET @test_collation= 'cp932_japanese_ci';
|
||||||
|
SET @safe_character_set_server= @@character_set_server;
|
||||||
|
SET @safe_collation_server= @@collation_server;
|
||||||
|
SET character_set_server= @test_character_set;
|
||||||
|
SET collation_server= @test_collation;
|
||||||
|
CREATE DATABASE d1;
|
||||||
|
USE d1;
|
||||||
|
CREATE TABLE t1 (c CHAR(10), KEY(c));
|
||||||
|
SHOW FULL COLUMNS FROM t1;
|
||||||
|
Field Type Collation Null Key Default Extra Privileges Comment
|
||||||
|
c char(10) cp932_japanese_ci YES MUL NULL
|
||||||
|
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
|
||||||
|
SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
|
||||||
|
want3results
|
||||||
|
aaa
|
||||||
|
aaaa
|
||||||
|
aaaaa
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
|
||||||
|
SHOW FULL COLUMNS FROM t1;
|
||||||
|
Field Type Collation Null Key Default Extra Privileges Comment
|
||||||
|
c1 varchar(15) cp932_japanese_ci YES MUL NULL
|
||||||
|
INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
|
||||||
|
SELECT c1 as want3results from t1 where c1 like 'l%';
|
||||||
|
want3results
|
||||||
|
location
|
||||||
|
loberge
|
||||||
|
lotre
|
||||||
|
SELECT c1 as want3results from t1 where c1 like 'lo%';
|
||||||
|
want3results
|
||||||
|
location
|
||||||
|
loberge
|
||||||
|
lotre
|
||||||
|
SELECT c1 as want1result from t1 where c1 like 'loc%';
|
||||||
|
want1result
|
||||||
|
location
|
||||||
|
SELECT c1 as want1result from t1 where c1 like 'loca%';
|
||||||
|
want1result
|
||||||
|
location
|
||||||
|
SELECT c1 as want1result from t1 where c1 like 'locat%';
|
||||||
|
want1result
|
||||||
|
location
|
||||||
|
SELECT c1 as want1result from t1 where c1 like 'locati%';
|
||||||
|
want1result
|
||||||
|
location
|
||||||
|
SELECT c1 as want1result from t1 where c1 like 'locatio%';
|
||||||
|
want1result
|
||||||
|
location
|
||||||
|
SELECT c1 as want1result from t1 where c1 like 'location%';
|
||||||
|
want1result
|
||||||
|
location
|
||||||
|
DROP TABLE t1;
|
||||||
|
create table t1 (a set('a') not null);
|
||||||
|
insert into t1 values (),();
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'a' doesn't have a default value
|
||||||
|
select cast(a as char(1)) from t1;
|
||||||
|
cast(a as char(1))
|
||||||
|
|
||||||
|
|
||||||
|
select a sounds like a from t1;
|
||||||
|
a sounds like a
|
||||||
|
1
|
||||||
|
1
|
||||||
|
select 1 from t1 order by cast(a as char(1));
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
drop table t1;
|
||||||
|
DROP DATABASE d1;
|
||||||
|
USE test;
|
||||||
|
SET character_set_server= @safe_character_set_server;
|
||||||
|
SET collation_server= @safe_collation_server;
|
||||||
set names cp932;
|
set names cp932;
|
||||||
set character_set_database = cp932;
|
set character_set_database = cp932;
|
||||||
CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = cp932;
|
CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = cp932;
|
||||||
|
@@ -2,6 +2,80 @@ drop table if exists t1;
|
|||||||
drop table if exists t2;
|
drop table if exists t2;
|
||||||
drop table if exists t3;
|
drop table if exists t3;
|
||||||
drop table if exists t4;
|
drop table if exists t4;
|
||||||
|
SET @test_character_set= 'cp932';
|
||||||
|
SET @test_collation= 'cp932_japanese_ci';
|
||||||
|
SET @safe_character_set_server= @@character_set_server;
|
||||||
|
SET @safe_collation_server= @@collation_server;
|
||||||
|
SET character_set_server= @test_character_set;
|
||||||
|
SET collation_server= @test_collation;
|
||||||
|
CREATE DATABASE d1;
|
||||||
|
USE d1;
|
||||||
|
CREATE TABLE t1 (c CHAR(10), KEY(c));
|
||||||
|
SHOW FULL COLUMNS FROM t1;
|
||||||
|
Field Type Collation Null Key Default Extra Privileges Comment
|
||||||
|
c char(10) cp932_japanese_ci YES MUL NULL
|
||||||
|
INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa');
|
||||||
|
SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%';
|
||||||
|
want3results
|
||||||
|
aaa
|
||||||
|
aaaa
|
||||||
|
aaaaa
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2)));
|
||||||
|
SHOW FULL COLUMNS FROM t1;
|
||||||
|
Field Type Collation Null Key Default Extra Privileges Comment
|
||||||
|
c1 varchar(15) cp932_japanese_ci YES MUL NULL
|
||||||
|
INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab');
|
||||||
|
SELECT c1 as want3results from t1 where c1 like 'l%';
|
||||||
|
want3results
|
||||||
|
location
|
||||||
|
loberge
|
||||||
|
lotre
|
||||||
|
SELECT c1 as want3results from t1 where c1 like 'lo%';
|
||||||
|
want3results
|
||||||
|
location
|
||||||
|
loberge
|
||||||
|
lotre
|
||||||
|
SELECT c1 as want1result from t1 where c1 like 'loc%';
|
||||||
|
want1result
|
||||||
|
location
|
||||||
|
SELECT c1 as want1result from t1 where c1 like 'loca%';
|
||||||
|
want1result
|
||||||
|
location
|
||||||
|
SELECT c1 as want1result from t1 where c1 like 'locat%';
|
||||||
|
want1result
|
||||||
|
location
|
||||||
|
SELECT c1 as want1result from t1 where c1 like 'locati%';
|
||||||
|
want1result
|
||||||
|
location
|
||||||
|
SELECT c1 as want1result from t1 where c1 like 'locatio%';
|
||||||
|
want1result
|
||||||
|
location
|
||||||
|
SELECT c1 as want1result from t1 where c1 like 'location%';
|
||||||
|
want1result
|
||||||
|
location
|
||||||
|
DROP TABLE t1;
|
||||||
|
create table t1 (a set('a') not null);
|
||||||
|
insert into t1 values (),();
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'a' doesn't have a default value
|
||||||
|
select cast(a as char(1)) from t1;
|
||||||
|
cast(a as char(1))
|
||||||
|
|
||||||
|
|
||||||
|
select a sounds like a from t1;
|
||||||
|
a sounds like a
|
||||||
|
1
|
||||||
|
1
|
||||||
|
select 1 from t1 order by cast(a as char(1));
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
drop table t1;
|
||||||
|
DROP DATABASE d1;
|
||||||
|
USE test;
|
||||||
|
SET character_set_server= @safe_character_set_server;
|
||||||
|
SET collation_server= @safe_collation_server;
|
||||||
set names cp932;
|
set names cp932;
|
||||||
set character_set_database = cp932;
|
set character_set_database = cp932;
|
||||||
CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = cp932;
|
CREATE TABLE t1(c1 CHAR(1)) DEFAULT CHARACTER SET = cp932;
|
||||||
|
@@ -1589,3 +1589,12 @@ SELECT * FROM t1 ORDER BY a;
|
|||||||
--enable_result_log
|
--enable_result_log
|
||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#31833 - ORDER BY leads to wrong result when ARCHIVE, BLOB and table
|
||||||
|
# cache is full
|
||||||
|
#
|
||||||
|
CREATE TABLE t1(a INT NOT NULL AUTO_INCREMENT, b BLOB, KEY(a)) ENGINE=archive;
|
||||||
|
INSERT INTO t1 VALUES (NULL, NULL),(NULL, NULL);
|
||||||
|
FLUSH TABLE t1;
|
||||||
|
SELECT * FROM t1 ORDER BY a;
|
||||||
|
@@ -1755,9 +1755,9 @@ insert into t1 values();
|
|||||||
select BIN(a) from t1;
|
select BIN(a) from t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
# We prevent creation of table with nullable ENUM
|
# We prevent creation of table with nullable ENUM
|
||||||
--error ER_CANT_CREATE_TABLE
|
--error ER_CHECK_NOT_IMPLEMENTED
|
||||||
create table t1(a enum('foo','bar') default null) engine=csv;
|
create table t1(a enum('foo','bar') default null) engine=csv;
|
||||||
--error ER_CANT_CREATE_TABLE
|
--error ER_CHECK_NOT_IMPLEMENTED
|
||||||
create table t1(a enum('foo','bar') default 'foo') engine=csv;
|
create table t1(a enum('foo','bar') default 'foo') engine=csv;
|
||||||
# Enum columns must be specified as NOT NULL
|
# Enum columns must be specified as NOT NULL
|
||||||
create table t1(a enum('foo','bar') default 'foo' not null) engine=csv;
|
create table t1(a enum('foo','bar') default 'foo' not null) engine=csv;
|
||||||
@@ -1765,5 +1765,12 @@ insert into t1 values();
|
|||||||
select * from t1;
|
select * from t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#32817 - though CSV is marked as supported create table is rejected
|
||||||
|
# with error 1005.
|
||||||
|
#
|
||||||
|
--error ER_CHECK_NOT_IMPLEMENTED
|
||||||
|
CREATE TABLE t1(a INT) ENGINE=CSV;
|
||||||
|
SHOW WARNINGS;
|
||||||
|
|
||||||
--echo End of 5.1 tests
|
--echo End of 5.1 tests
|
||||||
|
@@ -243,6 +243,16 @@ FLUSH TABLE t1;
|
|||||||
SELECT HEX(a) FROM t1;
|
SELECT HEX(a) FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #32676: insert delayed crash with wrong column and function specified
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT);
|
||||||
|
--error ER_BAD_FIELD_ERROR
|
||||||
|
INSERT DELAYED INTO t1 SET b= b();
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo End of 5.0 tests
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bug#27358 INSERT DELAYED does not honour SQL_MODE of the client
|
# Bug#27358 INSERT DELAYED does not honour SQL_MODE of the client
|
||||||
#
|
#
|
||||||
@@ -275,3 +285,4 @@ INSERT DELAYED INTO t2 VALUES (0,'0000-00-00');
|
|||||||
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
|
INSERT DELAYED INTO t2 VALUES (0,'2007-00-00');
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
|
|
||||||
|
--echo End of 5.1 tests
|
||||||
|
@@ -16,7 +16,6 @@ ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Do
|
|||||||
|
|
||||||
federated_transactions : Bug#29523 Transactions do not work
|
federated_transactions : Bug#29523 Transactions do not work
|
||||||
events : Bug#32664 events.test fails randomly
|
events : Bug#32664 events.test fails randomly
|
||||||
events_scheduling : Bug#29830 Test case 'events_scheduling' fails on Mac OS X and Windows
|
|
||||||
lowercase_table3 : Bug#32667 lowercase_table3.test reports to error log
|
lowercase_table3 : Bug#32667 lowercase_table3.test reports to error log
|
||||||
kill : Bug#29149: Test "kill" fails on Windows
|
kill : Bug#29149: Test "kill" fails on Windows
|
||||||
innodb_mysql : Bug#32724: innodb_mysql.test fails randomly
|
innodb_mysql : Bug#32724: innodb_mysql.test fails randomly
|
||||||
|
@@ -87,7 +87,7 @@ SELECT IF(TIME_TO_SEC(TIMEDIFF(ENDS,STARTS))=6, 'OK', 'ERROR')
|
|||||||
FROM INFORMATION_SCHEMA.EVENTS
|
FROM INFORMATION_SCHEMA.EVENTS
|
||||||
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
|
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
|
||||||
|
|
||||||
SELECT IF(LAST_EXECUTED-ENDS < 3, 'OK', 'ERROR')
|
SELECT IF(LAST_EXECUTED-ENDS <= 0, 'OK', 'ERROR')
|
||||||
FROM INFORMATION_SCHEMA.EVENTS
|
FROM INFORMATION_SCHEMA.EVENTS
|
||||||
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
|
WHERE EVENT_SCHEMA=DATABASE() AND EVENT_NAME='event_2';
|
||||||
|
|
||||||
|
@@ -221,6 +221,17 @@ insert into t1 values (-1), (-2);
|
|||||||
select min(a) from t1 group by inet_ntoa(a);
|
select min(a) from t1 group by inet_ntoa(a);
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #32559: connection hangs on query with name_const
|
||||||
|
#
|
||||||
|
CREATE TABLE t1(a INT);
|
||||||
|
INSERT INTO t1 VALUES (), (), ();
|
||||||
|
--error ER_WRONG_ARGUMENTS
|
||||||
|
SELECT NAME_CONST(a, '1') FROM t1;
|
||||||
|
--error ER_WRONG_ARGUMENTS
|
||||||
|
SET INSERT_ID= NAME_CONST(a, a);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
--echo End of 5.0 tests
|
--echo End of 5.0 tests
|
||||||
|
|
||||||
#
|
#
|
||||||
|
41
mysql-test/t/merge_innodb.test
Normal file
41
mysql-test/t/merge_innodb.test
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# t/merge_innodb.test
|
||||||
|
#
|
||||||
|
# Tests with MERGE tables over InnoDB tables
|
||||||
|
#
|
||||||
|
|
||||||
|
--source include/have_innodb.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS t1, t2, t3, t4, t5;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#30491 - MERGE doesn't report error when one table is Innodb
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (c1 varchar(100)) ENGINE=MyISAM;
|
||||||
|
CREATE TABLE t2 (c1 varchar(100)) ENGINE=MyISAM;
|
||||||
|
CREATE TABLE t3 (c1 varchar(100)) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 VALUES ('Ann'), ('Alice');
|
||||||
|
INSERT INTO t2 VALUES ('Bob'), ('Brian');
|
||||||
|
INSERT INTO t3 VALUES ('Chris'), ('Charlie');
|
||||||
|
CREATE TABLE t4 (c1 varchar(100)) ENGINE=MRG_MYISAM UNION=(t1,t2)
|
||||||
|
INSERT_METHOD=LAST;
|
||||||
|
CREATE TABLE t5 (c1 varchar(100)) ENGINE=MRG_MYISAM UNION=(t1,t3)
|
||||||
|
INSERT_METHOD=LAST;
|
||||||
|
--error ER_WRONG_MRG_TABLE
|
||||||
|
SELECT * FROM t5;
|
||||||
|
SELECT * FROM t4;
|
||||||
|
ALTER TABLE t2 ENGINE=InnoDB;
|
||||||
|
--error ER_WRONG_MRG_TABLE
|
||||||
|
SELECT * FROM t4;
|
||||||
|
DELETE FROM t2 LIMIT 1;
|
||||||
|
--error ER_WRONG_MRG_TABLE
|
||||||
|
SELECT * FROM t4;
|
||||||
|
--error ER_WRONG_MRG_TABLE
|
||||||
|
INSERT INTO t4 VALUES ('Beware');
|
||||||
|
--error ER_WRONG_MRG_TABLE
|
||||||
|
SELECT * FROM t4;
|
||||||
|
SELECT * FROM t2;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
DROP TABLE t1, t2, t3, t4, t5;
|
||||||
|
|
@@ -1556,4 +1556,42 @@ ALTER TABLE t1 OPTIMIZE PARTITION p1 EXTENDED;
|
|||||||
ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED;
|
ALTER TABLE t1 ANALYZE PARTITION p1 EXTENDED;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #29258: Partitions: search fails for maximum unsigned bigint
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (s1 BIGINT UNSIGNED)
|
||||||
|
PARTITION BY RANGE (s1) (
|
||||||
|
PARTITION p0 VALUES LESS THAN (0),
|
||||||
|
PARTITION p1 VALUES LESS THAN (1),
|
||||||
|
PARTITION p2 VALUES LESS THAN (18446744073709551615)
|
||||||
|
);
|
||||||
|
INSERT INTO t1 VALUES (0), (18446744073709551614);
|
||||||
|
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
|
||||||
|
INSERT INTO t1 VALUES (18446744073709551615);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (s1 BIGINT UNSIGNED)
|
||||||
|
PARTITION BY RANGE (s1) (
|
||||||
|
PARTITION p0 VALUES LESS THAN (0),
|
||||||
|
PARTITION p1 VALUES LESS THAN (1),
|
||||||
|
PARTITION p2 VALUES LESS THAN (18446744073709551614),
|
||||||
|
PARTITION p3 VALUES LESS THAN MAXVALUE
|
||||||
|
);
|
||||||
|
INSERT INTO t1 VALUES (-1), (0), (18446744073709551613),
|
||||||
|
(18446744073709551614), (18446744073709551615);
|
||||||
|
SELECT * FROM t1;
|
||||||
|
SELECT * FROM t1 WHERE s1 = 0;
|
||||||
|
SELECT * FROM t1 WHERE s1 = 18446744073709551614;
|
||||||
|
SELECT * FROM t1 WHERE s1 = 18446744073709551615;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (s1 BIGINT UNSIGNED)
|
||||||
|
PARTITION BY RANGE (s1) (
|
||||||
|
PARTITION p0 VALUES LESS THAN (0),
|
||||||
|
PARTITION p1 VALUES LESS THAN (1),
|
||||||
|
PARTITION p2 VALUES LESS THAN (18446744073709551615),
|
||||||
|
PARTITION p3 VALUES LESS THAN MAXVALUE
|
||||||
|
);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
--echo End of 5.1 tests
|
--echo End of 5.1 tests
|
||||||
|
@@ -9,6 +9,22 @@
|
|||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#30822: crash when COALESCE
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (c1 INT)
|
||||||
|
PARTITION BY HASH (c1)
|
||||||
|
PARTITIONS 15;
|
||||||
|
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
|
||||||
|
ALTER TABLE t1 COALESCE PARTITION 13;
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (c1 INT)
|
||||||
|
PARTITION BY LINEAR HASH (c1)
|
||||||
|
PARTITIONS 5;
|
||||||
|
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
|
||||||
|
ALTER TABLE t1 COALESCE PARTITION 3;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
#
|
#
|
||||||
# More partition pruning tests, especially on interval walking
|
# More partition pruning tests, especially on interval walking
|
||||||
#
|
#
|
||||||
|
@@ -1649,8 +1649,6 @@ err:
|
|||||||
void
|
void
|
||||||
Event_queue_element::mark_last_executed(THD *thd)
|
Event_queue_element::mark_last_executed(THD *thd)
|
||||||
{
|
{
|
||||||
thd->set_current_time();
|
|
||||||
|
|
||||||
last_executed= (my_time_t) thd->query_start();
|
last_executed= (my_time_t) thd->query_start();
|
||||||
last_executed_changed= TRUE;
|
last_executed_changed= TRUE;
|
||||||
|
|
||||||
|
@@ -1531,6 +1531,14 @@ int ha_partition::copy_partitions(ulonglong *copied, ulonglong *deleted)
|
|||||||
longlong func_value;
|
longlong func_value;
|
||||||
DBUG_ENTER("ha_partition::copy_partitions");
|
DBUG_ENTER("ha_partition::copy_partitions");
|
||||||
|
|
||||||
|
if (m_part_info->linear_hash_ind)
|
||||||
|
{
|
||||||
|
if (m_part_info->part_type == HASH_PARTITION)
|
||||||
|
set_linear_hash_mask(m_part_info, m_part_info->no_parts);
|
||||||
|
else
|
||||||
|
set_linear_hash_mask(m_part_info, m_part_info->no_subparts);
|
||||||
|
}
|
||||||
|
|
||||||
while (reorg_part < m_reorged_parts)
|
while (reorg_part < m_reorged_parts)
|
||||||
{
|
{
|
||||||
handler *file= m_reorged_file[reorg_part];
|
handler *file= m_reorged_file[reorg_part];
|
||||||
@@ -3983,7 +3991,8 @@ int ha_partition::handle_unordered_next(uchar *buf, bool is_next_same)
|
|||||||
}
|
}
|
||||||
else if (!(error= file->index_next(buf)))
|
else if (!(error= file->index_next(buf)))
|
||||||
{
|
{
|
||||||
if (compare_key(end_range) <= 0)
|
if (!(file->table_flags() & HA_READ_ORDER) ||
|
||||||
|
compare_key(end_range) <= 0)
|
||||||
{
|
{
|
||||||
m_last_part= m_part_spec.start_part;
|
m_last_part= m_part_spec.start_part;
|
||||||
DBUG_RETURN(0); // Row was in range
|
DBUG_RETURN(0); // Row was in range
|
||||||
@@ -4060,7 +4069,8 @@ int ha_partition::handle_unordered_scan_next_partition(uchar * buf)
|
|||||||
}
|
}
|
||||||
if (!error)
|
if (!error)
|
||||||
{
|
{
|
||||||
if (compare_key(end_range) <= 0)
|
if (!(file->table_flags() & HA_READ_ORDER) ||
|
||||||
|
compare_key(end_range) <= 0)
|
||||||
{
|
{
|
||||||
m_last_part= i;
|
m_last_part= i;
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
|
12
sql/item.cc
12
sql/item.cc
@@ -1240,7 +1240,17 @@ bool Item_name_const::is_null()
|
|||||||
|
|
||||||
Item::Type Item_name_const::type() const
|
Item::Type Item_name_const::type() const
|
||||||
{
|
{
|
||||||
return value_item->type();
|
/*
|
||||||
|
As
|
||||||
|
1. one can try to create the Item_name_const passing non-constant
|
||||||
|
arguments, although it's incorrect and
|
||||||
|
2. the type() method can be called before the fix_fields() to get
|
||||||
|
type information for a further type cast, e.g.
|
||||||
|
if (item->type() == FIELD_ITEM)
|
||||||
|
((Item_field *) item)->...
|
||||||
|
we return NULL_ITEM in the case to avoid wrong casting.
|
||||||
|
*/
|
||||||
|
return valid_args ? value_item->type() : NULL_ITEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1242,11 +1242,13 @@ class Item_name_const : public Item
|
|||||||
{
|
{
|
||||||
Item *value_item;
|
Item *value_item;
|
||||||
Item *name_item;
|
Item *name_item;
|
||||||
|
bool valid_args;
|
||||||
public:
|
public:
|
||||||
Item_name_const(Item *name_arg, Item *val):
|
Item_name_const(Item *name_arg, Item *val):
|
||||||
value_item(val), name_item(name_arg)
|
value_item(val), name_item(name_arg)
|
||||||
{
|
{
|
||||||
if(!value_item->basic_const_item())
|
if (!(valid_args= name_item->basic_const_item() &
|
||||||
|
value_item->basic_const_item()))
|
||||||
my_error(ER_WRONG_ARGUMENTS, MYF(0), "NAME_CONST");
|
my_error(ER_WRONG_ARGUMENTS, MYF(0), "NAME_CONST");
|
||||||
Item::maybe_null= TRUE;
|
Item::maybe_null= TRUE;
|
||||||
}
|
}
|
||||||
|
@@ -524,6 +524,13 @@ bool partition_info::check_range_constants()
|
|||||||
current_largest= part_range_value;
|
current_largest= part_range_value;
|
||||||
range_int_array[i]= part_range_value;
|
range_int_array[i]= part_range_value;
|
||||||
}
|
}
|
||||||
|
else if (defined_max_value &&
|
||||||
|
current_largest == part_range_value &&
|
||||||
|
part_range_value == LONGLONG_MAX &&
|
||||||
|
i == (no_parts - 1))
|
||||||
|
{
|
||||||
|
range_int_array[i]= part_range_value;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
my_error(ER_RANGE_NOT_INCREASING_ERROR, MYF(0));
|
my_error(ER_RANGE_NOT_INCREASING_ERROR, MYF(0));
|
||||||
|
@@ -574,7 +574,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
|
|||||||
bool log_on= ((thd->options & OPTION_BIN_LOG) ||
|
bool log_on= ((thd->options & OPTION_BIN_LOG) ||
|
||||||
(!(thd->security_ctx->master_access & SUPER_ACL)));
|
(!(thd->security_ctx->master_access & SUPER_ACL)));
|
||||||
#endif
|
#endif
|
||||||
thr_lock_type lock_type = table_list->lock_type;
|
thr_lock_type lock_type;
|
||||||
Item *unused_conds= 0;
|
Item *unused_conds= 0;
|
||||||
DBUG_ENTER("mysql_insert");
|
DBUG_ENTER("mysql_insert");
|
||||||
|
|
||||||
@@ -609,6 +609,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
|
|||||||
if (open_and_lock_tables(thd, table_list))
|
if (open_and_lock_tables(thd, table_list))
|
||||||
DBUG_RETURN(TRUE);
|
DBUG_RETURN(TRUE);
|
||||||
}
|
}
|
||||||
|
lock_type= table_list->lock_type;
|
||||||
|
|
||||||
thd->proc_info="init";
|
thd->proc_info="init";
|
||||||
thd->used_tables=0;
|
thd->used_tables=0;
|
||||||
@@ -626,7 +627,6 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
|
|||||||
|
|
||||||
/* mysql_prepare_insert set table_list->table if it was not set */
|
/* mysql_prepare_insert set table_list->table if it was not set */
|
||||||
table= table_list->table;
|
table= table_list->table;
|
||||||
lock_type= table_list->lock_type;
|
|
||||||
|
|
||||||
context= &thd->lex->select_lex.context;
|
context= &thd->lex->select_lex.context;
|
||||||
/*
|
/*
|
||||||
|
@@ -1402,7 +1402,7 @@ static void set_up_partition_func_pointers(partition_info *part_info)
|
|||||||
NONE
|
NONE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void set_linear_hash_mask(partition_info *part_info, uint no_parts)
|
void set_linear_hash_mask(partition_info *part_info, uint no_parts)
|
||||||
{
|
{
|
||||||
uint mask;
|
uint mask;
|
||||||
|
|
||||||
@@ -2834,8 +2834,8 @@ int get_partition_id_range(partition_info *part_info,
|
|||||||
loc_part_id++;
|
loc_part_id++;
|
||||||
*part_id= (uint32)loc_part_id;
|
*part_id= (uint32)loc_part_id;
|
||||||
if (loc_part_id == max_partition &&
|
if (loc_part_id == max_partition &&
|
||||||
range_array[loc_part_id] != LONGLONG_MAX &&
|
part_func_value >= range_array[loc_part_id] &&
|
||||||
part_func_value >= range_array[loc_part_id])
|
!part_info->defined_max_value)
|
||||||
DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
|
DBUG_RETURN(HA_ERR_NO_PARTITION_FOUND);
|
||||||
|
|
||||||
DBUG_PRINT("exit",("partition: %d", *part_id));
|
DBUG_PRINT("exit",("partition: %d", *part_id));
|
||||||
@@ -2941,7 +2941,13 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
|
|||||||
}
|
}
|
||||||
if (left_endpoint)
|
if (left_endpoint)
|
||||||
{
|
{
|
||||||
if (part_func_value >= range_array[loc_part_id])
|
longlong bound= range_array[loc_part_id];
|
||||||
|
/*
|
||||||
|
In case of PARTITION p VALUES LESS THAN MAXVALUE
|
||||||
|
the maximum value is in the current partition.
|
||||||
|
*/
|
||||||
|
if (part_func_value > bound ||
|
||||||
|
(part_func_value == bound && !part_info->defined_max_value))
|
||||||
loc_part_id++;
|
loc_part_id++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -65,6 +65,7 @@ int get_part_for_delete(const uchar *buf, const uchar *rec0,
|
|||||||
void prune_partition_set(const TABLE *table, part_id_range *part_spec);
|
void prune_partition_set(const TABLE *table, part_id_range *part_spec);
|
||||||
bool check_partition_info(partition_info *part_info,handlerton **eng_type,
|
bool check_partition_info(partition_info *part_info,handlerton **eng_type,
|
||||||
TABLE *table, handler *file, HA_CREATE_INFO *info);
|
TABLE *table, handler *file, HA_CREATE_INFO *info);
|
||||||
|
void set_linear_hash_mask(partition_info *part_info, uint no_parts);
|
||||||
bool fix_partition_func(THD *thd, TABLE *table, bool create_table_ind);
|
bool fix_partition_func(THD *thd, TABLE *table, bool create_table_ind);
|
||||||
char *generate_partition_syntax(partition_info *part_info,
|
char *generate_partition_syntax(partition_info *part_info,
|
||||||
uint *buf_length, bool use_sql_alloc,
|
uint *buf_length, bool use_sql_alloc,
|
||||||
|
@@ -262,7 +262,7 @@ void check_header(azio_stream *s)
|
|||||||
if (len) s->inbuf[0] = s->stream.next_in[0];
|
if (len) s->inbuf[0] = s->stream.next_in[0];
|
||||||
errno = 0;
|
errno = 0;
|
||||||
len = (uInt)my_read(s->file, (uchar *)s->inbuf + len, AZ_BUFSIZE_READ >> len, MYF(0));
|
len = (uInt)my_read(s->file, (uchar *)s->inbuf + len, AZ_BUFSIZE_READ >> len, MYF(0));
|
||||||
if (len == 0) s->z_err = Z_ERRNO;
|
if (len == (uInt)-1) s->z_err = Z_ERRNO;
|
||||||
s->stream.avail_in += len;
|
s->stream.avail_in += len;
|
||||||
s->stream.next_in = s->inbuf;
|
s->stream.next_in = s->inbuf;
|
||||||
if (s->stream.avail_in < 2) {
|
if (s->stream.avail_in < 2) {
|
||||||
|
@@ -472,14 +472,6 @@ int ha_tina::encode_quote(uchar *buf)
|
|||||||
const char *ptr;
|
const char *ptr;
|
||||||
const char *end_ptr;
|
const char *end_ptr;
|
||||||
const bool was_null= (*field)->is_null();
|
const bool was_null= (*field)->is_null();
|
||||||
|
|
||||||
/*
|
|
||||||
CSV does not support nulls. ::create() prevents creation of a table
|
|
||||||
with nullable columns so if we encounter them here, there is a bug.
|
|
||||||
This may only occur if the frm was created by an older version of
|
|
||||||
mysqld which permitted table creation with nullable columns.
|
|
||||||
*/
|
|
||||||
DBUG_ASSERT(!(*field)->maybe_null());
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
assistance for backwards compatibility in production builds.
|
assistance for backwards compatibility in production builds.
|
||||||
@@ -1494,7 +1486,10 @@ int ha_tina::create(const char *name, TABLE *table_arg,
|
|||||||
for (Field **field= table_arg->s->field; *field; field++)
|
for (Field **field= table_arg->s->field; *field; field++)
|
||||||
{
|
{
|
||||||
if ((*field)->real_maybe_null())
|
if ((*field)->real_maybe_null())
|
||||||
DBUG_RETURN(-1);
|
{
|
||||||
|
my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "nullable columns");
|
||||||
|
DBUG_RETURN(HA_ERR_UNSUPPORTED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -5360,12 +5360,12 @@ my_wc_mb_cp932(CHARSET_INFO *cs __attribute__((unused)),
|
|||||||
static int
|
static int
|
||||||
my_mb_wc_cp932(CHARSET_INFO *cs __attribute__((unused)),
|
my_mb_wc_cp932(CHARSET_INFO *cs __attribute__((unused)),
|
||||||
my_wc_t *pwc, const uchar *s, const uchar *e){
|
my_wc_t *pwc, const uchar *s, const uchar *e){
|
||||||
int hi=s[0];
|
int hi;
|
||||||
|
|
||||||
if (s >= e)
|
if (s >= e)
|
||||||
return MY_CS_TOOSMALL;
|
return MY_CS_TOOSMALL;
|
||||||
|
|
||||||
if (hi < 0x80)
|
if ((hi= s[0]) < 0x80)
|
||||||
{
|
{
|
||||||
pwc[0]=hi;
|
pwc[0]=hi;
|
||||||
return 1;
|
return 1;
|
||||||
|
Reference in New Issue
Block a user