Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into april.(none):/home/svoj/devel/mysql/BUG14194/mysql-5.1-new
This commit is contained in:
commit
74c475b23d
@ -95,6 +95,9 @@ extern "C" {
|
||||
/* On NetWare, stack grows towards lower address*/
|
||||
#define STACK_DIRECTION -1
|
||||
|
||||
/* On NetWare, we need to set stack size for threads, otherwise default 16K is used */
|
||||
#define NW_THD_STACKSIZE 65536
|
||||
|
||||
/* On NetWare, to fix the problem with the deletion of open files */
|
||||
#define CANT_DELETE_OPEN_FILES 1
|
||||
|
||||
|
4
mysql-test/include/have_euckr.inc
Normal file
4
mysql-test/include/have_euckr.inc
Normal file
@ -0,0 +1,4 @@
|
||||
-- require r/have_euckr.require
|
||||
disable_query_log;
|
||||
show collation like "euckr_korean_ci";
|
||||
enable_query_log;
|
4
mysql-test/include/have_gb2312.inc
Normal file
4
mysql-test/include/have_gb2312.inc
Normal file
@ -0,0 +1,4 @@
|
||||
-- require r/have_gb2312.require
|
||||
disable_query_log;
|
||||
show collation like "gb2312_chinese_ci";
|
||||
enable_query_log;
|
@ -947,7 +947,8 @@ sub executable_setup () {
|
||||
{
|
||||
$path_client_bindir= mtr_path_exists("$glob_basedir/client_release",
|
||||
"$glob_basedir/bin");
|
||||
$exe_mysqld= mtr_exe_exists ("$path_client_bindir/mysqld-nt",
|
||||
$exe_mysqld= mtr_exe_exists ("$path_client_bindir/mysqld-max",
|
||||
"$path_client_bindir/mysqld-nt",
|
||||
"$path_client_bindir/mysqld",
|
||||
"$path_client_bindir/mysqld-debug",);
|
||||
$path_language= mtr_path_exists("$glob_basedir/share/english/");
|
||||
|
@ -11,6 +11,7 @@ MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
|
||||
MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
|
||||
TimeBetweenGlobalCheckpoints= 500
|
||||
NoOfFragmentLogFiles= 3
|
||||
DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
|
||||
|
||||
[ndbd]
|
||||
HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
|
||||
|
@ -11,6 +11,7 @@ MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
|
||||
MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
|
||||
TimeBetweenGlobalCheckpoints= 500
|
||||
NoOfFragmentLogFiles= 3
|
||||
DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
|
||||
|
||||
[ndbd]
|
||||
HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
|
||||
|
@ -11,6 +11,7 @@ MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
|
||||
MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
|
||||
TimeBetweenGlobalCheckpoints= 500
|
||||
NoOfFragmentLogFiles= 3
|
||||
DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
|
||||
|
||||
[ndbd]
|
||||
HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
|
||||
|
@ -58,6 +58,7 @@ ndb_no_attr=2048
|
||||
ndb_con_op=105000
|
||||
ndb_dmem=80M
|
||||
ndb_imem=24M
|
||||
ndb_pbmem=32M
|
||||
|
||||
VERBOSE=100
|
||||
NDB_MGM_EXTRA_OPTS=
|
||||
@ -90,6 +91,7 @@ while test $# -gt 0; do
|
||||
ndb_con_op=5000
|
||||
ndb_dmem=10M
|
||||
ndb_imem=1M
|
||||
ndb_pbmem=4M
|
||||
;;
|
||||
--diskless)
|
||||
ndb_diskless=1
|
||||
@ -206,6 +208,7 @@ if [ $initial_ndb ] ; then
|
||||
-e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \
|
||||
-e s,"CHOOSE_FILESYSTEM","$fs_ndb",g \
|
||||
-e s,"CHOOSE_PORT_MGM","$ndb_mgmd_port",g \
|
||||
-e s,"CHOOSE_DiskPageBufferMemory","$ndb_pbmem",g \
|
||||
< "$config_ini" \
|
||||
> "$fs_ndb/config.ini"
|
||||
fi
|
||||
|
167
mysql-test/r/ctype_euckr.result
Normal file
167
mysql-test/r/ctype_euckr.result
Normal file
@ -0,0 +1,167 @@
|
||||
drop table if exists t1;
|
||||
SET @test_character_set= 'euckr';
|
||||
SET @test_collation= 'euckr_korean_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) euckr_korean_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) euckr_korean_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;
|
||||
DROP DATABASE d1;
|
||||
USE test;
|
||||
SET character_set_server= @safe_character_set_server;
|
||||
SET collation_server= @safe_collation_server;
|
||||
SET NAMES euckr;
|
||||
SET collation_connection='euckr_korean_ci';
|
||||
create table t1 select repeat('a',4000) a;
|
||||
delete from t1;
|
||||
insert into t1 values ('a'), ('a '), ('a\t');
|
||||
select collation(a),hex(a) from t1 order by a;
|
||||
collation(a) hex(a)
|
||||
euckr_korean_ci 6109
|
||||
euckr_korean_ci 61
|
||||
euckr_korean_ci 6120
|
||||
drop table t1;
|
||||
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||
alter table t1 add index(c1(5));
|
||||
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||
select collation(c1) from t1 limit 1;
|
||||
collation(c1)
|
||||
euckr_korean_ci
|
||||
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||
c1
|
||||
abcdefg
|
||||
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||
c1
|
||||
abcde100
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||
c1
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||
c1
|
||||
abcde111
|
||||
drop table t1;
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
euckr_korean_ci
|
||||
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
|
||||
insert into t1 values('abcdef');
|
||||
insert into t1 values('_bcdef');
|
||||
insert into t1 values('a_cdef');
|
||||
insert into t1 values('ab_def');
|
||||
insert into t1 values('abc_ef');
|
||||
insert into t1 values('abcd_f');
|
||||
insert into t1 values('abcde_');
|
||||
select c1 as c1u from t1 where c1 like 'ab\_def';
|
||||
c1u
|
||||
ab_def
|
||||
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
|
||||
c2h
|
||||
ab_def
|
||||
drop table t1;
|
||||
SET collation_connection='euckr_bin';
|
||||
create table t1 select repeat('a',4000) a;
|
||||
delete from t1;
|
||||
insert into t1 values ('a'), ('a '), ('a\t');
|
||||
select collation(a),hex(a) from t1 order by a;
|
||||
collation(a) hex(a)
|
||||
euckr_bin 6109
|
||||
euckr_bin 61
|
||||
euckr_bin 6120
|
||||
drop table t1;
|
||||
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||
alter table t1 add index(c1(5));
|
||||
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||
select collation(c1) from t1 limit 1;
|
||||
collation(c1)
|
||||
euckr_bin
|
||||
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||
c1
|
||||
abcdefg
|
||||
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||
c1
|
||||
abcde100
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||
c1
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||
c1
|
||||
abcde111
|
||||
drop table t1;
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
euckr_bin
|
||||
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
|
||||
insert into t1 values('abcdef');
|
||||
insert into t1 values('_bcdef');
|
||||
insert into t1 values('a_cdef');
|
||||
insert into t1 values('ab_def');
|
||||
insert into t1 values('abc_ef');
|
||||
insert into t1 values('abcd_f');
|
||||
insert into t1 values('abcde_');
|
||||
select c1 as c1u from t1 where c1 like 'ab\_def';
|
||||
c1u
|
||||
ab_def
|
||||
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
|
||||
c2h
|
||||
ab_def
|
||||
drop table t1;
|
||||
SET NAMES euckr;
|
||||
CREATE TABLE t1 (a text) character set euckr;
|
||||
INSERT INTO t1 VALUES (0xA2E6),(0xFEF7);
|
||||
SELECT hex(a) FROM t1 ORDER BY a;
|
||||
hex(a)
|
||||
A2E6
|
||||
FEF7
|
||||
DROP TABLE t1;
|
167
mysql-test/r/ctype_gb2312.result
Normal file
167
mysql-test/r/ctype_gb2312.result
Normal file
@ -0,0 +1,167 @@
|
||||
drop table if exists t1;
|
||||
SET @test_character_set= 'gb2312';
|
||||
SET @test_collation= 'gb2312_chinese_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) gb2312_chinese_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) gb2312_chinese_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;
|
||||
DROP DATABASE d1;
|
||||
USE test;
|
||||
SET character_set_server= @safe_character_set_server;
|
||||
SET collation_server= @safe_collation_server;
|
||||
SET NAMES gb2312;
|
||||
SET collation_connection='gb2312_chinese_ci';
|
||||
create table t1 select repeat('a',4000) a;
|
||||
delete from t1;
|
||||
insert into t1 values ('a'), ('a '), ('a\t');
|
||||
select collation(a),hex(a) from t1 order by a;
|
||||
collation(a) hex(a)
|
||||
gb2312_chinese_ci 6109
|
||||
gb2312_chinese_ci 61
|
||||
gb2312_chinese_ci 6120
|
||||
drop table t1;
|
||||
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||
alter table t1 add index(c1(5));
|
||||
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||
select collation(c1) from t1 limit 1;
|
||||
collation(c1)
|
||||
gb2312_chinese_ci
|
||||
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||
c1
|
||||
abcdefg
|
||||
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||
c1
|
||||
abcde100
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||
c1
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||
c1
|
||||
abcde111
|
||||
drop table t1;
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
gb2312_chinese_ci
|
||||
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
|
||||
insert into t1 values('abcdef');
|
||||
insert into t1 values('_bcdef');
|
||||
insert into t1 values('a_cdef');
|
||||
insert into t1 values('ab_def');
|
||||
insert into t1 values('abc_ef');
|
||||
insert into t1 values('abcd_f');
|
||||
insert into t1 values('abcde_');
|
||||
select c1 as c1u from t1 where c1 like 'ab\_def';
|
||||
c1u
|
||||
ab_def
|
||||
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
|
||||
c2h
|
||||
ab_def
|
||||
drop table t1;
|
||||
SET collation_connection='gb2312_bin';
|
||||
create table t1 select repeat('a',4000) a;
|
||||
delete from t1;
|
||||
insert into t1 values ('a'), ('a '), ('a\t');
|
||||
select collation(a),hex(a) from t1 order by a;
|
||||
collation(a) hex(a)
|
||||
gb2312_bin 6109
|
||||
gb2312_bin 61
|
||||
gb2312_bin 6120
|
||||
drop table t1;
|
||||
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||
alter table t1 add index(c1(5));
|
||||
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||
select collation(c1) from t1 limit 1;
|
||||
collation(c1)
|
||||
gb2312_bin
|
||||
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||
c1
|
||||
abcdefg
|
||||
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||
c1
|
||||
abcde100
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||
c1
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||
c1
|
||||
abcde111
|
||||
drop table t1;
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
gb2312_bin
|
||||
create table t1 ROW_FORMAT=DYNAMIC select repeat('a',50) as c1 ;
|
||||
insert into t1 values('abcdef');
|
||||
insert into t1 values('_bcdef');
|
||||
insert into t1 values('a_cdef');
|
||||
insert into t1 values('ab_def');
|
||||
insert into t1 values('abc_ef');
|
||||
insert into t1 values('abcd_f');
|
||||
insert into t1 values('abcde_');
|
||||
select c1 as c1u from t1 where c1 like 'ab\_def';
|
||||
c1u
|
||||
ab_def
|
||||
select c1 as c2h from t1 where c1 like 'ab#_def' escape '#';
|
||||
c2h
|
||||
ab_def
|
||||
drop table t1;
|
||||
SET NAMES gb2312;
|
||||
CREATE TABLE t1 (a text) character set gb2312;
|
||||
INSERT INTO t1 VALUES (0xA2A1),(0xD7FE);
|
||||
SELECT hex(a) FROM t1 ORDER BY a;
|
||||
hex(a)
|
||||
A2A1
|
||||
D7FE
|
||||
DROP TABLE t1;
|
@ -1058,6 +1058,14 @@ char(a)
|
||||
1
|
||||
2
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (t TINYTEXT CHARACTER SET utf8);
|
||||
INSERT INTO t1 VALUES(REPEAT('a', 100));
|
||||
CREATE TEMPORARY TABLE t2 SELECT COALESCE(t) AS bug FROM t1;
|
||||
SELECT LENGTH(bug) FROM t2;
|
||||
LENGTH(bug)
|
||||
100
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8;
|
||||
INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa');
|
||||
SELECT id FROM t1;
|
||||
|
@ -441,3 +441,11 @@ SELECT a FROM t1 WHERE MATCH a AGAINST('test' IN BOOLEAN MODE);
|
||||
a
|
||||
test's
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a VARCHAR(10000), FULLTEXT(a));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10000) default NULL,
|
||||
FULLTEXT KEY `a` (`a`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
|
@ -865,6 +865,7 @@ select 1, min(a) from t1m where 1=99;
|
||||
1 NULL
|
||||
select 1, min(1) from t1m where a=99;
|
||||
1 min(1)
|
||||
1 NULL
|
||||
select 1, min(1) from t1m where 1=99;
|
||||
1 min(1)
|
||||
1 NULL
|
||||
@ -876,6 +877,7 @@ select 1, max(a) from t1m where 1=99;
|
||||
1 NULL
|
||||
select 1, max(1) from t1m where a=99;
|
||||
1 max(1)
|
||||
1 NULL
|
||||
select 1, max(1) from t1m where 1=99;
|
||||
1 max(1)
|
||||
1 NULL
|
||||
|
2
mysql-test/r/have_euckr.require
Normal file
2
mysql-test/r/have_euckr.require
Normal file
@ -0,0 +1,2 @@
|
||||
Collation Charset Id Default Compiled Sortlen
|
||||
euckr_korean_ci euckr 19 Yes Yes 1
|
2
mysql-test/r/have_gb2312.require
Normal file
2
mysql-test/r/have_gb2312.require
Normal file
@ -0,0 +1,2 @@
|
||||
Collation Charset Id Default Compiled Sortlen
|
||||
gb2312_chinese_ci gb2312 24 Yes Yes 1
|
@ -384,3 +384,21 @@ max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.ke
|
||||
8186
|
||||
set join_buffer_size= @save_join_buffer_size;
|
||||
drop table t0, t1, t2, t3, t4;
|
||||
CREATE TABLE t1 (
|
||||
cola char(3) not null, colb char(3) not null, filler char(200),
|
||||
key(cola), key(colb)
|
||||
);
|
||||
INSERT INTO t1 VALUES ('foo','bar', 'ZZ'),('fuz','baz', 'ZZ');
|
||||
OPTIMIZE TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
8704
|
||||
explain select * from t1 WHERE cola = 'foo' AND colb = 'bar';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge cola,colb cola,colb 3,3 NULL 24 Using intersect(cola,colb); Using where
|
||||
explain select * from t1 force index(cola,colb) WHERE cola = 'foo' AND colb = 'bar';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge cola,colb cola,colb 3,3 NULL 24 Using intersect(cola,colb); Using where
|
||||
drop table t1;
|
||||
|
@ -3337,6 +3337,30 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 Using index
|
||||
1 SIMPLE t3 const PRIMARY PRIMARY 8 const,const 1
|
||||
DROP TABLE t1,t2,t3;
|
||||
create table t1 (f1 int);
|
||||
insert into t1 values(1),(2);
|
||||
create table t2 (f2 int, f3 int, key(f2));
|
||||
insert into t2 values(1,1),(2,2);
|
||||
create table t3 (f4 int not null);
|
||||
insert into t3 values (2),(2),(2);
|
||||
select f1,(select count(*) from t2,t3 where f2=f1 and f3=f4) as count from t1;
|
||||
f1 count
|
||||
1 0
|
||||
2 3
|
||||
drop table t1,t2,t3;
|
||||
create table t1 (f1 int unique);
|
||||
create table t2 (f2 int unique);
|
||||
create table t3 (f3 int unique);
|
||||
insert into t1 values(1),(2);
|
||||
insert into t2 values(1),(2);
|
||||
insert into t3 values(1),(NULL);
|
||||
select * from t3 where f3 is null;
|
||||
f3
|
||||
NULL
|
||||
select t2.f2 from t1 left join t2 on f1=f2 join t3 on f1=f3 where f1=1;
|
||||
f2
|
||||
1
|
||||
drop table t1,t2,t3;
|
||||
create table t1(f1 char, f2 char not null);
|
||||
insert into t1 values(null,'a');
|
||||
create table t2 (f2 char not null);
|
||||
@ -3345,3 +3369,5 @@ select * from t1 left join t2 on f1=t2.f2 where t1.f2='a';
|
||||
f1 f2 f2
|
||||
NULL a NULL
|
||||
drop table t1,t2;
|
||||
select * from (select * left join t on f1=f2) tt;
|
||||
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 'on f1=f2) tt' at line 1
|
||||
|
@ -918,6 +918,11 @@ drop function if exists f5|
|
||||
drop function if exists f6|
|
||||
drop function if exists f7|
|
||||
drop function if exists f8|
|
||||
drop function if exists f9|
|
||||
drop function if exists f10|
|
||||
drop function if exists f11|
|
||||
drop function if exists f12_1|
|
||||
drop function if exists f12_2|
|
||||
drop view if exists v0|
|
||||
drop view if exists v1|
|
||||
drop view if exists v2|
|
||||
@ -1097,6 +1102,62 @@ ERROR HY000: Table 't1' was not locked with LOCK TABLES
|
||||
select f4()|
|
||||
ERROR HY000: Table 't2' was not locked with LOCK TABLES
|
||||
unlock tables|
|
||||
create function f9() returns int
|
||||
begin
|
||||
declare a, b int;
|
||||
drop temporary table if exists t3;
|
||||
create temporary table t3 (id int);
|
||||
insert into t3 values (1), (2), (3);
|
||||
set a:= (select count(*) from t3);
|
||||
set b:= (select count(*) from t3 t3_alias);
|
||||
return a + b;
|
||||
end|
|
||||
select f9()|
|
||||
f9()
|
||||
6
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't3'
|
||||
select f9() from t1 limit 1|
|
||||
f9()
|
||||
6
|
||||
create function f10() returns int
|
||||
begin
|
||||
drop temporary table if exists t3;
|
||||
create temporary table t3 (id int);
|
||||
insert into t3 select id from t4;
|
||||
return (select count(*) from t3);
|
||||
end|
|
||||
select f10()|
|
||||
ERROR 42S02: Table 'test.t4' doesn't exist
|
||||
create table t4 as select 1 as id|
|
||||
select f10()|
|
||||
f10()
|
||||
1
|
||||
create function f11() returns int
|
||||
begin
|
||||
drop temporary table if exists t3;
|
||||
create temporary table t3 (id int);
|
||||
insert into t3 values (1), (2), (3);
|
||||
return (select count(*) from t3 as a, t3 as b);
|
||||
end|
|
||||
select f11()|
|
||||
ERROR HY000: Can't reopen table: 'a'
|
||||
select f11() from t1|
|
||||
ERROR HY000: Can't reopen table: 'a'
|
||||
create function f12_1() returns int
|
||||
begin
|
||||
drop temporary table if exists t3;
|
||||
create temporary table t3 (id int);
|
||||
insert into t3 values (1), (2), (3);
|
||||
return f12_2();
|
||||
end|
|
||||
create function f12_2() returns int
|
||||
return (select count(*) from t3)|
|
||||
drop temporary table t3|
|
||||
select f12_1()|
|
||||
ERROR 42S02: Table 'test.t3' doesn't exist
|
||||
select f12_1() from t1 limit 1|
|
||||
ERROR 42S02: Table 'test.t3' doesn't exist
|
||||
drop function f0|
|
||||
drop function f1|
|
||||
drop function f2|
|
||||
@ -1106,11 +1167,17 @@ drop function f5|
|
||||
drop function f6|
|
||||
drop function f7|
|
||||
drop function f8|
|
||||
drop function f9|
|
||||
drop function f10|
|
||||
drop function f11|
|
||||
drop function f12_1|
|
||||
drop function f12_2|
|
||||
drop view v0|
|
||||
drop view v1|
|
||||
drop view v2|
|
||||
delete from t1 |
|
||||
delete from t2 |
|
||||
drop table t4|
|
||||
drop table if exists fac|
|
||||
create table fac (n int unsigned not null primary key, f bigint unsigned)|
|
||||
drop procedure if exists ifac|
|
||||
|
33
mysql-test/t/ctype_euckr.test
Normal file
33
mysql-test/t/ctype_euckr.test
Normal file
@ -0,0 +1,33 @@
|
||||
-- source include/have_euckr.inc
|
||||
|
||||
#
|
||||
# Tests with the euckr character set
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
SET @test_character_set= 'euckr';
|
||||
SET @test_collation= 'euckr_korean_ci';
|
||||
-- source include/ctype_common.inc
|
||||
|
||||
SET NAMES euckr;
|
||||
SET collation_connection='euckr_korean_ci';
|
||||
-- source include/ctype_filesort.inc
|
||||
-- source include/ctype_innodb_like.inc
|
||||
-- source include/ctype_like_escape.inc
|
||||
SET collation_connection='euckr_bin';
|
||||
-- source include/ctype_filesort.inc
|
||||
-- source include/ctype_innodb_like.inc
|
||||
-- source include/ctype_like_escape.inc
|
||||
|
||||
#
|
||||
# Bug#15377 Valid multibyte sequences are truncated on INSERT
|
||||
#
|
||||
SET NAMES euckr;
|
||||
CREATE TABLE t1 (a text) character set euckr;
|
||||
INSERT INTO t1 VALUES (0xA2E6),(0xFEF7);
|
||||
SELECT hex(a) FROM t1 ORDER BY a;
|
||||
DROP TABLE t1;
|
||||
|
||||
# End of 4.1 tests
|
33
mysql-test/t/ctype_gb2312.test
Normal file
33
mysql-test/t/ctype_gb2312.test
Normal file
@ -0,0 +1,33 @@
|
||||
-- source include/have_gb2312.inc
|
||||
|
||||
#
|
||||
# Tests with the gb2312 character set
|
||||
#
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
SET @test_character_set= 'gb2312';
|
||||
SET @test_collation= 'gb2312_chinese_ci';
|
||||
-- source include/ctype_common.inc
|
||||
|
||||
SET NAMES gb2312;
|
||||
SET collation_connection='gb2312_chinese_ci';
|
||||
-- source include/ctype_filesort.inc
|
||||
-- source include/ctype_innodb_like.inc
|
||||
-- source include/ctype_like_escape.inc
|
||||
SET collation_connection='gb2312_bin';
|
||||
-- source include/ctype_filesort.inc
|
||||
-- source include/ctype_innodb_like.inc
|
||||
-- source include/ctype_like_escape.inc
|
||||
|
||||
#
|
||||
# Bug#15377 Valid multibyte sequences are truncated on INSERT
|
||||
#
|
||||
SET NAMES gb2312;
|
||||
CREATE TABLE t1 (a text) character set gb2312;
|
||||
INSERT INTO t1 VALUES (0xA2A1),(0xD7FE);
|
||||
SELECT hex(a) FROM t1 ORDER BY a;
|
||||
DROP TABLE t1;
|
||||
|
||||
# End of 4.1 tests
|
@ -868,6 +868,16 @@ set names utf8;
|
||||
select distinct char(a) from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug#15581: COALESCE function truncates mutli-byte TINYTEXT values
|
||||
#
|
||||
CREATE TABLE t1 (t TINYTEXT CHARACTER SET utf8);
|
||||
INSERT INTO t1 VALUES(REPEAT('a', 100));
|
||||
CREATE TEMPORARY TABLE t2 SELECT COALESCE(t) AS bug FROM t1;
|
||||
SELECT LENGTH(bug) FROM t2;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
|
@ -23,3 +23,5 @@ events : Affects flush test case. A table lock not released somewhere
|
||||
ndb_binlog_basic : Results are not deterministic, Tomas will fix
|
||||
rpl_ndb_basic : Bug#16228
|
||||
rpl_sp : Bug #16456
|
||||
ndb_autodiscover : Needs to be fixed w.r.t binlog
|
||||
ndb_autodiscover2 : Needs to be fixed w.r.t binlog
|
||||
|
@ -363,4 +363,12 @@ INSERT INTO t1 VALUES('test\'s');
|
||||
SELECT a FROM t1 WHERE MATCH a AGAINST('test' IN BOOLEAN MODE);
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# BUG#13835: max key length is 1000 bytes when trying to create
|
||||
# a fulltext index
|
||||
#
|
||||
CREATE TABLE t1 (a VARCHAR(10000), FULLTEXT(a));
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
@ -327,3 +327,33 @@ set join_buffer_size= @save_join_buffer_size;
|
||||
|
||||
drop table t0, t1, t2, t3, t4;
|
||||
|
||||
# BUG#16166
|
||||
CREATE TABLE t1 (
|
||||
cola char(3) not null, colb char(3) not null, filler char(200),
|
||||
key(cola), key(colb)
|
||||
);
|
||||
INSERT INTO t1 VALUES ('foo','bar', 'ZZ'),('fuz','baz', 'ZZ');
|
||||
|
||||
--disable_query_log
|
||||
let $1=9;
|
||||
while ($1)
|
||||
{
|
||||
eval INSERT INTO t1 SELECT * from t1 WHERE cola = 'foo';
|
||||
dec $1;
|
||||
}
|
||||
|
||||
let $1=13;
|
||||
while ($1)
|
||||
{
|
||||
eval INSERT INTO t1 SELECT * from t1 WHERE cola <> 'foo';
|
||||
dec $1;
|
||||
}
|
||||
|
||||
--enable_query_log
|
||||
|
||||
OPTIMIZE TABLE t1;
|
||||
select count(*) from t1;
|
||||
explain select * from t1 WHERE cola = 'foo' AND colb = 'bar';
|
||||
explain select * from t1 force index(cola,colb) WHERE cola = 'foo' AND colb = 'bar';
|
||||
drop table t1;
|
||||
|
||||
|
@ -2806,6 +2806,33 @@ EXPLAIN SELECT t2.key_a,foo
|
||||
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
||||
#
|
||||
# Bug#15347 Wrong result of subselect when records cache and set functions
|
||||
# are involved
|
||||
#
|
||||
create table t1 (f1 int);
|
||||
insert into t1 values(1),(2);
|
||||
create table t2 (f2 int, f3 int, key(f2));
|
||||
insert into t2 values(1,1),(2,2);
|
||||
create table t3 (f4 int not null);
|
||||
insert into t3 values (2),(2),(2);
|
||||
select f1,(select count(*) from t2,t3 where f2=f1 and f3=f4) as count from t1;
|
||||
drop table t1,t2,t3;
|
||||
|
||||
#
|
||||
# Bug #15633 Evaluation of Item_equal for non-const table caused wrong
|
||||
# select result
|
||||
#
|
||||
create table t1 (f1 int unique);
|
||||
create table t2 (f2 int unique);
|
||||
create table t3 (f3 int unique);
|
||||
insert into t1 values(1),(2);
|
||||
insert into t2 values(1),(2);
|
||||
insert into t3 values(1),(NULL);
|
||||
select * from t3 where f3 is null;
|
||||
select t2.f2 from t1 left join t2 on f1=f2 join t3 on f1=f3 where f1=1;
|
||||
drop table t1,t2,t3;
|
||||
|
||||
#
|
||||
# Bug#15268 Unchecked null value caused server crash
|
||||
#
|
||||
@ -2815,3 +2842,9 @@ create table t2 (f2 char not null);
|
||||
insert into t2 values('b');
|
||||
select * from t1 left join t2 on f1=t2.f2 where t1.f2='a';
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Bug#15538 unchecked table absense caused server crash.
|
||||
#
|
||||
--error 1064
|
||||
select * from (select * left join t on f1=f2) tt;
|
||||
|
@ -1157,6 +1157,11 @@ drop function if exists f5|
|
||||
drop function if exists f6|
|
||||
drop function if exists f7|
|
||||
drop function if exists f8|
|
||||
drop function if exists f9|
|
||||
drop function if exists f10|
|
||||
drop function if exists f11|
|
||||
drop function if exists f12_1|
|
||||
drop function if exists f12_2|
|
||||
drop view if exists v0|
|
||||
drop view if exists v1|
|
||||
drop view if exists v2|
|
||||
@ -1234,8 +1239,6 @@ create function f7() returns int
|
||||
select f6()|
|
||||
select id, f6() from t1|
|
||||
|
||||
# TODO Test temporary table handling
|
||||
|
||||
#
|
||||
# Let us test how new locking work with views
|
||||
#
|
||||
@ -1316,6 +1319,73 @@ select * from v1, t1|
|
||||
select f4()|
|
||||
unlock tables|
|
||||
|
||||
# Tests for handling of temporary tables in functions.
|
||||
#
|
||||
# Unlike for permanent tables we should be able to create, use
|
||||
# and drop such tables in functions.
|
||||
#
|
||||
# Simplest function using temporary table. It is also test case for bug
|
||||
# #12198 "Temporary table aliasing does not work inside stored functions"
|
||||
create function f9() returns int
|
||||
begin
|
||||
declare a, b int;
|
||||
drop temporary table if exists t3;
|
||||
create temporary table t3 (id int);
|
||||
insert into t3 values (1), (2), (3);
|
||||
set a:= (select count(*) from t3);
|
||||
set b:= (select count(*) from t3 t3_alias);
|
||||
return a + b;
|
||||
end|
|
||||
# This will emit warning as t3 was not existing before.
|
||||
select f9()|
|
||||
select f9() from t1 limit 1|
|
||||
|
||||
# Function which uses both temporary and permanent tables.
|
||||
create function f10() returns int
|
||||
begin
|
||||
drop temporary table if exists t3;
|
||||
create temporary table t3 (id int);
|
||||
insert into t3 select id from t4;
|
||||
return (select count(*) from t3);
|
||||
end|
|
||||
# Check that we don't ignore completely tables used in function
|
||||
--error ER_NO_SUCH_TABLE
|
||||
select f10()|
|
||||
create table t4 as select 1 as id|
|
||||
select f10()|
|
||||
|
||||
# Practical cases which we don't handle well (yet)
|
||||
#
|
||||
# Function which does not work because of well-known and documented
|
||||
# limitation of MySQL. We can't use the several instances of the
|
||||
# same temporary table in statement.
|
||||
create function f11() returns int
|
||||
begin
|
||||
drop temporary table if exists t3;
|
||||
create temporary table t3 (id int);
|
||||
insert into t3 values (1), (2), (3);
|
||||
return (select count(*) from t3 as a, t3 as b);
|
||||
end|
|
||||
--error ER_CANT_REOPEN_TABLE
|
||||
select f11()|
|
||||
--error ER_CANT_REOPEN_TABLE
|
||||
select f11() from t1|
|
||||
# We don't handle temporary tables used by nested functions well
|
||||
create function f12_1() returns int
|
||||
begin
|
||||
drop temporary table if exists t3;
|
||||
create temporary table t3 (id int);
|
||||
insert into t3 values (1), (2), (3);
|
||||
return f12_2();
|
||||
end|
|
||||
create function f12_2() returns int
|
||||
return (select count(*) from t3)|
|
||||
# We need clean start to get error
|
||||
drop temporary table t3|
|
||||
--error ER_NO_SUCH_TABLE
|
||||
select f12_1()|
|
||||
--error ER_NO_SUCH_TABLE
|
||||
select f12_1() from t1 limit 1|
|
||||
|
||||
# Cleanup
|
||||
drop function f0|
|
||||
@ -1327,11 +1397,17 @@ drop function f5|
|
||||
drop function f6|
|
||||
drop function f7|
|
||||
drop function f8|
|
||||
drop function f9|
|
||||
drop function f10|
|
||||
drop function f11|
|
||||
drop function f12_1|
|
||||
drop function f12_2|
|
||||
drop view v0|
|
||||
drop view v1|
|
||||
drop view v2|
|
||||
delete from t1 |
|
||||
delete from t2 |
|
||||
drop table t4|
|
||||
|
||||
# End of non-bug tests
|
||||
|
||||
|
@ -57,7 +57,7 @@ make
|
||||
cp extra/comp_err extra/comp_err.linux
|
||||
cp libmysql/conf_to_src libmysql/conf_to_src.linux
|
||||
#cp libmysql_r/conf_to_src libmysql_r/conf_to_src.linux
|
||||
cp sql/gen_lex_hash sql/gen_lex_hash.linux
|
||||
cp sql/.libs/gen_lex_hash sql/gen_lex_hash.linux
|
||||
cp strings/conf_to_src strings/conf_to_src.linux
|
||||
|
||||
# Delete mysql_version.h
|
||||
|
@ -258,11 +258,11 @@ void finish_defaults()
|
||||
void read_defaults(arg_list_t *pal)
|
||||
{
|
||||
arg_list_t al;
|
||||
char defaults_file[PATH_MAX];
|
||||
char defaults_file[PATH_MAX];
|
||||
char mydefaults[PATH_MAX];
|
||||
char line[PATH_MAX];
|
||||
FILE *fp;
|
||||
|
||||
|
||||
// defaults output file
|
||||
snprintf(defaults_file, PATH_MAX, "%s/bin/defaults.out", basedir);
|
||||
remove(defaults_file);
|
||||
@ -270,7 +270,7 @@ void read_defaults(arg_list_t *pal)
|
||||
// mysqladmin file
|
||||
snprintf(mydefaults, PATH_MAX, "%s/bin/my_print_defaults", basedir);
|
||||
|
||||
// args
|
||||
// args
|
||||
init_args(&al);
|
||||
add_arg(&al, mydefaults);
|
||||
if (default_option[0])
|
||||
@ -279,11 +279,11 @@ void read_defaults(arg_list_t *pal)
|
||||
add_arg(&al, "server");
|
||||
add_arg(&al, "mysqld_safe");
|
||||
add_arg(&al, "safe_mysqld");
|
||||
|
||||
|
||||
spawn(mydefaults, &al, TRUE, NULL, defaults_file, NULL);
|
||||
|
||||
|
||||
free_args(&al);
|
||||
|
||||
|
||||
// gather defaults
|
||||
if ((fp= fopen(defaults_file, "r")) != NULL)
|
||||
{
|
||||
|
@ -9068,11 +9068,11 @@ uint32 Field_blob::max_length()
|
||||
switch (packlength)
|
||||
{
|
||||
case 1:
|
||||
return 255;
|
||||
return 255 * field_charset->mbmaxlen;
|
||||
case 2:
|
||||
return 65535;
|
||||
return 65535 * field_charset->mbmaxlen;
|
||||
case 3:
|
||||
return 16777215;
|
||||
return 16777215 * field_charset->mbmaxlen;
|
||||
case 4:
|
||||
return (uint32) 4294967295U;
|
||||
default:
|
||||
|
@ -2510,6 +2510,7 @@ int ha_binlog_index_purge_file(THD *thd, const char *file)
|
||||
{
|
||||
binlog_func_st bfn= {BFN_BINLOG_PURGE_FILE, (void *)file};
|
||||
binlog_func_foreach(thd, &bfn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct binlog_log_query_st
|
||||
|
@ -3765,6 +3765,7 @@ void Item_equal::update_used_tables()
|
||||
|
||||
longlong Item_equal::val_int()
|
||||
{
|
||||
Item_field *item_field;
|
||||
if (cond_false)
|
||||
return 0;
|
||||
List_iterator_fast<Item_field> it(fields);
|
||||
@ -3772,10 +3773,14 @@ longlong Item_equal::val_int()
|
||||
if ((null_value= item->null_value))
|
||||
return 0;
|
||||
eval_item->store_value(item);
|
||||
while ((item= it++))
|
||||
while ((item_field= it++))
|
||||
{
|
||||
if ((null_value= item->null_value) || eval_item->cmp(item))
|
||||
return 0;
|
||||
/* Skip fields of non-const tables. They haven't been read yet */
|
||||
if (item_field->field->table->const_table)
|
||||
{
|
||||
if ((null_value= item_field->null_value) || eval_item->cmp(item_field))
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -1150,6 +1150,11 @@ public:
|
||||
are deleted in the end of execution. All changes made to these
|
||||
objects need not be registered in the list of changes of the parse
|
||||
tree and do not harm PS/SP re-execution.
|
||||
|
||||
Item equal objects are employed only at the optimize phase. Usually they are
|
||||
not supposed to be evaluated. Yet in some cases we call the method val_int()
|
||||
for them. We have to take care of restricting the predicate such an
|
||||
object represents f1=f2= ...=fn to the projection of known fields fi1=...=fik.
|
||||
*/
|
||||
|
||||
class Item_equal: public Item_bool_func
|
||||
|
@ -5123,7 +5123,7 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len,
|
||||
const uint byte_count= (m_width + 7) / 8;
|
||||
const byte* const ptr_rows_data= var_start + byte_count + 1;
|
||||
|
||||
my_size_t const data_size= event_len - (ptr_rows_data - buf);
|
||||
my_size_t const data_size= event_len - (ptr_rows_data - (const byte *) buf);
|
||||
DBUG_PRINT("info",("m_table_id=%lu, m_flags=%d, m_width=%u, data_size=%lu",
|
||||
m_table_id, m_flags, m_width, data_size));
|
||||
|
||||
@ -6038,7 +6038,7 @@ bool Table_map_log_event::write_data_body(IO_CACHE *file)
|
||||
DBUG_ASSERT(static_cast<my_size_t>(cbuf_end - cbuf) <= sizeof(cbuf));
|
||||
|
||||
return (my_b_safe_write(file, dbuf, sizeof(dbuf)) ||
|
||||
my_b_safe_write(file, m_dbnam, m_dblen+1) ||
|
||||
my_b_safe_write(file, (const byte*)m_dbnam, m_dblen+1) ||
|
||||
my_b_safe_write(file, tbuf, sizeof(tbuf)) ||
|
||||
my_b_safe_write(file, (const byte*)m_tblnam, m_tbllen+1) ||
|
||||
my_b_safe_write(file, cbuf, cbuf_end - cbuf) ||
|
||||
@ -6056,7 +6056,7 @@ bool Table_map_log_event::write_data_body(IO_CACHE *file)
|
||||
void Table_map_log_event::pack_info(Protocol *protocol)
|
||||
{
|
||||
char buf[256];
|
||||
my_size_t bytes= snprintf(buf, sizeof(buf), "%s.%s", m_dbnam, m_tblnam);
|
||||
my_size_t bytes= my_snprintf(buf, sizeof(buf), "%s.%s", m_dbnam, m_tblnam);
|
||||
protocol->store(buf, bytes, &my_charset_bin);
|
||||
}
|
||||
|
||||
@ -6171,7 +6171,7 @@ char const *Write_rows_log_event::do_prepare_row(THD *thd, TABLE *table,
|
||||
*/
|
||||
DBUG_ASSERT(table->s->fields >= m_width);
|
||||
DBUG_ASSERT(ptr);
|
||||
ptr= unpack_row(table, (char*)table->record[0], ptr, &m_cols);
|
||||
ptr= unpack_row(table, table->record[0], ptr, &m_cols);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
@ -3493,6 +3493,11 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef __NETWARE__
|
||||
/* Increasing stacksize of threads on NetWare */
|
||||
|
||||
pthread_attr_setstacksize(&connection_attrib, NW_THD_STACKSIZE);
|
||||
#endif
|
||||
|
||||
(void) thr_setconcurrency(concurrency); // 10 by default
|
||||
|
||||
|
@ -3146,7 +3146,14 @@ sp_restore_security_context(THD *thd, Security_context *backup)
|
||||
|
||||
typedef struct st_sp_table
|
||||
{
|
||||
LEX_STRING qname; /* Multi-set key: db_name\0table_name\0alias\0 */
|
||||
/*
|
||||
Multi-set key:
|
||||
db_name\0table_name\0alias\0 - for normal tables
|
||||
db_name\0table_name\0 - for temporary tables
|
||||
Note that in both cases we don't take last '\0' into account when
|
||||
we count length of key.
|
||||
*/
|
||||
LEX_STRING qname;
|
||||
uint db_length, table_name_length;
|
||||
bool temp; /* true if corresponds to a temporary table */
|
||||
thr_lock_type lock_type; /* lock type used for prelocking */
|
||||
@ -3216,10 +3223,14 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check)
|
||||
tname[tlen]= '\0';
|
||||
|
||||
/*
|
||||
It is safe to store pointer to table list elements in hash,
|
||||
since they are supposed to have the same lifetime.
|
||||
We ignore alias when we check if table was already marked as temporary
|
||||
(and therefore should not be prelocked). Otherwise we will erroneously
|
||||
treat table with same name but with different alias as non-temporary.
|
||||
*/
|
||||
if ((tab= (SP_TABLE *)hash_search(&m_sptabs, (byte *)tname, tlen)))
|
||||
if ((tab= (SP_TABLE *)hash_search(&m_sptabs, (byte *)tname, tlen)) ||
|
||||
((tab= (SP_TABLE *)hash_search(&m_sptabs, (byte *)tname,
|
||||
tlen - alen - 1)) &&
|
||||
tab->temp))
|
||||
{
|
||||
if (tab->lock_type < table->lock_type)
|
||||
tab->lock_type= table->lock_type; // Use the table with the highest lock type
|
||||
@ -3231,14 +3242,18 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check)
|
||||
{
|
||||
if (!(tab= (SP_TABLE *)thd->calloc(sizeof(SP_TABLE))))
|
||||
return FALSE;
|
||||
tab->qname.length= tlen;
|
||||
tab->qname.str= (char*) thd->memdup(tname, tab->qname.length + 1);
|
||||
if (!tab->qname.str)
|
||||
return FALSE;
|
||||
if (lex_for_tmp_check->sql_command == SQLCOM_CREATE_TABLE &&
|
||||
lex_for_tmp_check->query_tables == table &&
|
||||
lex_for_tmp_check->create_info.options & HA_LEX_CREATE_TMP_TABLE)
|
||||
{
|
||||
tab->temp= TRUE;
|
||||
tab->qname.length= tlen - alen - 1;
|
||||
}
|
||||
else
|
||||
tab->qname.length= tlen;
|
||||
tab->qname.str= (char*) thd->memdup(tname, tab->qname.length + 1);
|
||||
if (!tab->qname.str)
|
||||
return FALSE;
|
||||
tab->table_name_length= table->table_name_length;
|
||||
tab->db_length= table->db_length;
|
||||
tab->lock_type= table->lock_type;
|
||||
|
@ -2083,8 +2083,10 @@ static bool reopen_table(TABLE *table)
|
||||
(*field)->table_name= &table->alias;
|
||||
}
|
||||
for (key=0 ; key < table->s->keys ; key++)
|
||||
{
|
||||
for (part=0 ; part < table->key_info[key].usable_key_parts ; part++)
|
||||
table->key_info[key].key_part[part].field->table= table;
|
||||
}
|
||||
if (table->triggers)
|
||||
table->triggers->set_table(table);
|
||||
|
||||
|
@ -2330,7 +2330,7 @@ my_size_t THD::max_row_length_blob(TABLE *table, const byte *data) const
|
||||
for (uint *ptr= beg ; ptr != end ; ++ptr)
|
||||
{
|
||||
Field_blob* const blob= (Field_blob*) table->field[*ptr];
|
||||
length+= blob->get_length(data + blob->offset()) + 2;
|
||||
length+= blob->get_length((const char *) (data + blob->offset())) + 2;
|
||||
}
|
||||
|
||||
return length;
|
||||
@ -2349,7 +2349,7 @@ my_size_t THD::pack_row(TABLE *table, MY_BITMAP const* cols, byte *row_data,
|
||||
for (int i= 0 ; field ; i++, p_field++, field= *p_field)
|
||||
{
|
||||
if (bitmap_is_set(cols,i))
|
||||
ptr= (byte*)field->pack(ptr, field->ptr + offset);
|
||||
ptr= (byte*)field->pack((char *) ptr, field->ptr + offset);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2382,12 +2382,12 @@ int THD::binlog_write_row(TABLE* table, bool is_trans,
|
||||
if (!table->s->blob_fields)
|
||||
{
|
||||
/* multiply max_len by 2 so it can be used for update_row as well */
|
||||
table->write_row_record= alloc_root(&table->mem_root, 2*max_len);
|
||||
table->write_row_record= (byte *) alloc_root(&table->mem_root, 2*max_len);
|
||||
if (!table->write_row_record)
|
||||
return HA_ERR_OUT_OF_MEM;
|
||||
row_data= table->write_row_record;
|
||||
}
|
||||
else if (unlikely(!(row_data= my_malloc(max_len, MYF(MY_WME)))))
|
||||
else if (unlikely(!(row_data= (byte *) my_malloc(max_len, MYF(MY_WME)))))
|
||||
return HA_ERR_OUT_OF_MEM;
|
||||
}
|
||||
my_size_t const len= pack_row(table, cols, row_data, record);
|
||||
@ -2401,7 +2401,7 @@ int THD::binlog_write_row(TABLE* table, bool is_trans,
|
||||
error= likely(ev != 0) ? ev->add_row_data(row_data,len) : HA_ERR_OUT_OF_MEM ;
|
||||
|
||||
if (table->write_row_record == 0)
|
||||
my_free(row_data, MYF(MY_WME));
|
||||
my_free((gptr) row_data, MYF(MY_WME));
|
||||
|
||||
return error;
|
||||
}
|
||||
|
@ -424,7 +424,11 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
|
||||
|
||||
if (cond && ((!cond->fixed &&
|
||||
cond->fix_fields(thd, &cond)) || cond->check_cols(1)))
|
||||
{
|
||||
if (table->query_id != thd->query_id)
|
||||
cond->cleanup(); // File was reopened
|
||||
goto err0;
|
||||
}
|
||||
|
||||
if (keyname)
|
||||
{
|
||||
|
@ -3508,13 +3508,32 @@ best_access_path(JOIN *join,
|
||||
parts of the row from any of the used index.
|
||||
This is because table scans uses index and we would not win
|
||||
anything by using a table scan.
|
||||
|
||||
A word for word translation of the below if-statement in psergey's
|
||||
understanding: we check if we should use table scan if:
|
||||
(1) The found 'ref' access produces more records than a table scan
|
||||
(or index scan, or quick select), or 'ref' is more expensive than
|
||||
any of them.
|
||||
(2) This doesn't hold: the best way to perform table scan is to to perform
|
||||
'range' access using index IDX, and the best way to perform 'ref'
|
||||
access is to use the same index IDX, with the same or more key parts.
|
||||
(note: it is not clear how this rule is/should be extended to
|
||||
index_merge quick selects)
|
||||
(3) See above note about InnoDB.
|
||||
(4) NOT ("FORCE INDEX(...)" is used for table and there is 'ref' access
|
||||
path, but there is no quick select)
|
||||
If the condition in the above brackets holds, then the only possible
|
||||
"table scan" access method is ALL/index (there is no quick select).
|
||||
Since we have a 'ref' access path, and FORCE INDEX instructs us to
|
||||
choose it over ALL/index, there is no need to consider a full table
|
||||
scan.
|
||||
*/
|
||||
if ((records >= s->found_records || best > s->read_time) &&
|
||||
!(s->quick && best_key && s->quick->index == best_key->key &&
|
||||
best_max_key_part >= s->table->quick_key_parts[best_key->key]) &&
|
||||
!((s->table->file->table_flags() & HA_TABLE_SCAN_ON_INDEX) &&
|
||||
! s->table->used_keys.is_clear_all() && best_key) &&
|
||||
!(s->table->force_index && best_key))
|
||||
if ((records >= s->found_records || best > s->read_time) && // (1)
|
||||
!(s->quick && best_key && s->quick->index == best_key->key && // (2)
|
||||
best_max_key_part >= s->table->quick_key_parts[best_key->key]) &&// (2)
|
||||
!((s->table->file->table_flags() & HA_TABLE_SCAN_ON_INDEX) && // (3)
|
||||
! s->table->used_keys.is_clear_all() && best_key) && // (3)
|
||||
!(s->table->force_index && best_key && !s->quick)) // (4)
|
||||
{ // Check full join
|
||||
ha_rows rnd_records= s->found_records;
|
||||
/*
|
||||
@ -4497,13 +4516,15 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
|
||||
parts of the row from any of the used index.
|
||||
This is because table scans uses index and we would not win
|
||||
anything by using a table scan.
|
||||
(see comment in best_access_path() for more details on the below
|
||||
condition)
|
||||
*/
|
||||
if ((records >= s->found_records || best > s->read_time) &&
|
||||
!(s->quick && best_key && s->quick->index == best_key->key &&
|
||||
best_max_key_part >= s->table->quick_key_parts[best_key->key]) &&
|
||||
!((s->table->file->table_flags() & HA_TABLE_SCAN_ON_INDEX) &&
|
||||
! s->table->used_keys.is_clear_all() && best_key) &&
|
||||
!(s->table->force_index && best_key))
|
||||
!(s->table->force_index && best_key && !s->quick))
|
||||
{ // Check full join
|
||||
ha_rows rnd_records= s->found_records;
|
||||
/*
|
||||
@ -8651,6 +8672,11 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
|
||||
have null
|
||||
*/
|
||||
hidden_null_count=null_count;
|
||||
/*
|
||||
We need to update hidden_field_count as we may have stored group
|
||||
functions with constant arguments
|
||||
*/
|
||||
param->hidden_field_count= (uint) (reg_field - table->field);
|
||||
null_count= 0;
|
||||
}
|
||||
}
|
||||
@ -8872,7 +8898,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
|
||||
}
|
||||
}
|
||||
|
||||
if (distinct)
|
||||
if (distinct && field_count != param->hidden_field_count)
|
||||
{
|
||||
/*
|
||||
Create an unique key or an unique constraint over all columns
|
||||
@ -9938,6 +9964,7 @@ flush_cached_records(JOIN *join,JOIN_TAB *join_tab,bool skip_last)
|
||||
int error;
|
||||
READ_RECORD *info;
|
||||
|
||||
join_tab->table->null_row= 0;
|
||||
if (!join_tab->cache.records)
|
||||
return NESTED_LOOP_OK; /* Nothing to do */
|
||||
if (skip_last)
|
||||
|
@ -2734,12 +2734,15 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
|
||||
field->real_type() == MYSQL_TYPE_VARCHAR || // For varbinary type
|
||||
field->real_type() == MYSQL_TYPE_STRING) // For binary type
|
||||
{
|
||||
uint32 octet_max_length= field->max_length();
|
||||
if (octet_max_length != (uint32) 4294967295U)
|
||||
octet_max_length /= field->charset()->mbmaxlen;
|
||||
longlong char_max_len= is_blob ?
|
||||
(longlong) field->max_length() / field->charset()->mbminlen :
|
||||
(longlong) field->max_length() / field->charset()->mbmaxlen;
|
||||
(longlong) octet_max_length / field->charset()->mbminlen :
|
||||
(longlong) octet_max_length / field->charset()->mbmaxlen;
|
||||
table->field[8]->store(char_max_len, TRUE);
|
||||
table->field[8]->set_notnull();
|
||||
table->field[9]->store((longlong) field->max_length(), TRUE);
|
||||
table->field[9]->store((longlong) octet_max_length, TRUE);
|
||||
table->field[9]->set_notnull();
|
||||
}
|
||||
|
||||
|
@ -1523,7 +1523,7 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
|
||||
my_error(ER_WRONG_KEY_COLUMN, MYF(0), column->field_name);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
if (length > file->max_key_part_length())
|
||||
if (length > file->max_key_part_length() && key->type != Key::FULLTEXT)
|
||||
{
|
||||
length=file->max_key_part_length();
|
||||
if (key->type == Key::MULTIPLE)
|
||||
|
@ -6710,13 +6710,13 @@ join_table:
|
||||
| table_ref LEFT opt_outer JOIN_SYM table_ref
|
||||
ON
|
||||
{
|
||||
YYERROR_UNLESS($1 && $5);
|
||||
/* Change the current name resolution context to a local context. */
|
||||
if (push_new_name_resolution_context(YYTHD, $1, $5))
|
||||
YYABORT;
|
||||
}
|
||||
expr
|
||||
{
|
||||
YYERROR_UNLESS($1 && $5);
|
||||
add_join_on($5,$8);
|
||||
Lex->pop_context();
|
||||
$5->outer_join|=JOIN_TYPE_LEFT;
|
||||
@ -6741,6 +6741,7 @@ join_table:
|
||||
| table_ref RIGHT opt_outer JOIN_SYM table_ref
|
||||
ON
|
||||
{
|
||||
YYERROR_UNLESS($1 && $5);
|
||||
/* Change the current name resolution context to a local context. */
|
||||
if (push_new_name_resolution_context(YYTHD, $1, $5))
|
||||
YYABORT;
|
||||
@ -6748,7 +6749,6 @@ join_table:
|
||||
expr
|
||||
{
|
||||
LEX *lex= Lex;
|
||||
YYERROR_UNLESS($1 && $5);
|
||||
if (!($$= lex->current_select->convert_right_join()))
|
||||
YYABORT;
|
||||
add_join_on($$, $8);
|
||||
|
@ -147,6 +147,15 @@ os_thread_create(
|
||||
"InnoDB: Error: pthread_attr_setstacksize returned %d\n", ret);
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
#ifdef __NETWARE__
|
||||
ret = pthread_attr_setstacksize(&attr,
|
||||
(size_t) NW_THD_STACKSIZE);
|
||||
if (ret) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Error: pthread_attr_setstacksize returned %d\n", ret);
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
os_mutex_enter(os_sync_mutex);
|
||||
os_thread_count++;
|
||||
|
@ -141,4 +141,16 @@
|
||||
*/
|
||||
#define NDB_SECTION_SEGMENT_SZ 60
|
||||
|
||||
/*
|
||||
* Restore Buffer in pages
|
||||
* 4M
|
||||
*/
|
||||
#define LCP_RESTORE_BUFFER (4*32)
|
||||
|
||||
/*
|
||||
* Log buffer pages
|
||||
* 8M
|
||||
*/
|
||||
#define LGMAN_LOG_BUFFER (8*32)
|
||||
|
||||
#endif
|
||||
|
@ -85,6 +85,8 @@
|
||||
|
||||
#define CFG_DB_MAX_OPEN_FILES 159
|
||||
|
||||
#define CFG_DB_DISK_PAGE_BUFFER_MEMORY 160
|
||||
|
||||
#define CFG_NODE_ARBIT_RANK 200
|
||||
#define CFG_NODE_ARBIT_DELAY 201
|
||||
|
||||
|
@ -93,7 +93,6 @@ Cmvmi::Cmvmi(const Configuration & conf) :
|
||||
addRecSignal(GSN_TESTSIG, &Cmvmi::execTESTSIG);
|
||||
|
||||
subscriberPool.setSize(5);
|
||||
m_global_page_pool.setSize(1024+256, true);
|
||||
|
||||
const ndb_mgm_configuration_iterator * db = theConfig.getOwnConfigIterator();
|
||||
for(unsigned j = 0; j<LogLevel::LOGLEVEL_CATEGORIES; j++){
|
||||
@ -322,6 +321,17 @@ Cmvmi::execREAD_CONFIG_REQ(Signal* signal)
|
||||
theConfiguration.getOwnConfigIterator();
|
||||
ndbrequire(p != 0);
|
||||
|
||||
Uint64 page_buffer = 64*1024*1024;
|
||||
ndb_mgm_get_int64_parameter(p, CFG_DB_DISK_PAGE_BUFFER_MEMORY, &page_buffer);
|
||||
|
||||
page_buffer /= GLOBAL_PAGE_SIZE; // in pages
|
||||
if (page_buffer > 0)
|
||||
{
|
||||
page_buffer += LGMAN_LOG_BUFFER;
|
||||
}
|
||||
page_buffer += LCP_RESTORE_BUFFER;
|
||||
m_global_page_pool.setSize(page_buffer + 64, true);
|
||||
|
||||
ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
|
||||
conf->senderRef = reference();
|
||||
conf->senderData = senderData;
|
||||
|
@ -771,10 +771,14 @@ void Dblqh::execREAD_NODESCONF(Signal* signal)
|
||||
jam();
|
||||
if (NodeBitmask::get(readNodes->allNodes, i)) {
|
||||
jam();
|
||||
m_sr_nodes.set(i);
|
||||
cnodeData[ind] = i;
|
||||
cnodeStatus[ind] = NodeBitmask::get(readNodes->inactiveNodes, i);
|
||||
//readNodes->getVersionId(i, readNodes->theVersionIds) not used
|
||||
if (!NodeBitmask::get(readNodes->inactiveNodes, i))
|
||||
{
|
||||
jam();
|
||||
m_sr_nodes.set(i);
|
||||
}
|
||||
ind++;
|
||||
}//if
|
||||
}//for
|
||||
|
@ -25,12 +25,13 @@
|
||||
struct UndoPage
|
||||
{
|
||||
File_formats::Page_header m_page_header;
|
||||
Uint32 _tupdata1;
|
||||
Uint32 m_state; // Used by buddy alg
|
||||
Uint32 m_words_used;
|
||||
Uint32 m_ref_count;
|
||||
Uint32 m_data[GLOBAL_PAGE_SIZE_WORDS-3-(sizeof(File_formats::Page_header)>>2)];
|
||||
Uint32 m_data[GLOBAL_PAGE_SIZE_WORDS-4-(sizeof(File_formats::Page_header)>>2)];
|
||||
|
||||
STATIC_CONST( DATA_WORDS = GLOBAL_PAGE_SIZE_WORDS-3-(sizeof(File_formats::Page_header)>>2) );
|
||||
STATIC_CONST( DATA_WORDS = GLOBAL_PAGE_SIZE_WORDS-4-(sizeof(File_formats::Page_header)>>2) );
|
||||
};
|
||||
|
||||
Undo_buffer::Undo_buffer(Dbtup* tup)
|
||||
|
@ -84,8 +84,6 @@ Pgman::Pgman(const Configuration & conf) :
|
||||
m_cleanup_ptr.i = RNIL;
|
||||
|
||||
// should be a factor larger than number of pool pages
|
||||
m_page_entry_pool.setSize(2000);
|
||||
m_page_request_pool.setSize(10000);
|
||||
m_data_buffer_pool.setSize(1);
|
||||
m_page_hashlist.setSize(512);
|
||||
|
||||
@ -115,6 +113,18 @@ Pgman::execREAD_CONFIG_REQ(Signal* signal)
|
||||
theConfiguration.getOwnConfigIterator();
|
||||
ndbrequire(p != 0);
|
||||
|
||||
Uint64 page_buffer = 64*1024*1024;
|
||||
ndb_mgm_get_int64_parameter(p, CFG_DB_DISK_PAGE_BUFFER_MEMORY, &page_buffer);
|
||||
|
||||
if (page_buffer > 0)
|
||||
{
|
||||
page_buffer /= GLOBAL_PAGE_SIZE; // in pages
|
||||
m_page_entry_pool.setSize(2*page_buffer);
|
||||
m_page_request_pool.setSize(10000);
|
||||
m_param.m_max_pages = page_buffer;
|
||||
m_param.m_max_hot_pages = (page_buffer * 9) / 10;
|
||||
}
|
||||
|
||||
ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
|
||||
conf->senderRef = reference();
|
||||
conf->senderData = senderData;
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <dbtup/Dbtup.hpp>
|
||||
#include <KeyDescriptor.hpp>
|
||||
|
||||
#define PAGES (4*32)
|
||||
#define PAGES LCP_RESTORE_BUFFER
|
||||
|
||||
Restore::Restore(const Configuration & conf) :
|
||||
SimulatedBlock(RESTORE, conf),
|
||||
|
@ -557,7 +557,11 @@ private:
|
||||
|
||||
struct Buffer_page
|
||||
{
|
||||
STATIC_CONST( DATA_WORDS = 8192 - 5);
|
||||
STATIC_CONST( DATA_WORDS = 8192 - 9);
|
||||
Uint32 _tupdata1;
|
||||
Uint32 _tupdata2;
|
||||
Uint32 _tupdata3;
|
||||
Uint32 _tupdata4;
|
||||
Uint32 m_page_state; // Used by TUP buddy algorithm
|
||||
Uint32 m_page_chunk_ptr_i;
|
||||
Uint32 m_next_page;
|
||||
|
@ -760,6 +760,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
|
||||
"512k",
|
||||
STR_VALUE(MAX_INT_RNIL)},
|
||||
|
||||
{
|
||||
CFG_DB_DISK_PAGE_BUFFER_MEMORY,
|
||||
"DiskPageBufferMemory",
|
||||
DB_TOKEN,
|
||||
"Number bytes on each "DB_TOKEN_PRINT" node allocated for disk page buffer cache",
|
||||
ConfigInfo::CI_USED,
|
||||
false,
|
||||
ConfigInfo::CI_INT64,
|
||||
"64M",
|
||||
"4M",
|
||||
"1024G" },
|
||||
|
||||
{
|
||||
CFG_DB_START_PARTIAL_TIMEOUT,
|
||||
"StartPartialTimeout",
|
||||
|
@ -8635,6 +8635,41 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Returns well formed length of a EUC-KR string.
|
||||
*/
|
||||
static uint
|
||||
my_well_formed_len_euckr(CHARSET_INFO *cs __attribute__((unused)),
|
||||
const char *b, const char *e,
|
||||
uint pos, int *error)
|
||||
{
|
||||
const char *b0= b;
|
||||
const char *emb= e - 1; /* Last possible end of an MB character */
|
||||
|
||||
*error= 0;
|
||||
while (pos-- && b < e)
|
||||
{
|
||||
if ((uchar) b[0] < 128)
|
||||
{
|
||||
/* Single byte ascii character */
|
||||
b++;
|
||||
}
|
||||
else if (b < emb && iseuc_kr(*b) && iseuc_kr(b[1]))
|
||||
{
|
||||
/* Double byte character */
|
||||
b+= 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Wrong byte sequence */
|
||||
*error= 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (uint) (b - b0);
|
||||
}
|
||||
|
||||
|
||||
static MY_COLLATION_HANDLER my_collation_ci_handler =
|
||||
{
|
||||
NULL, /* init */
|
||||
@ -8657,7 +8692,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
|
||||
mbcharlen_euc_kr,
|
||||
my_numchars_mb,
|
||||
my_charpos_mb,
|
||||
my_well_formed_len_mb,
|
||||
my_well_formed_len_euckr,
|
||||
my_lengthsp_8bit,
|
||||
my_numcells_8bit,
|
||||
my_mb_wc_euc_kr, /* mb_wc */
|
||||
|
@ -5686,6 +5686,41 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)),
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Returns well formed length of a EUC-KR string.
|
||||
*/
|
||||
static uint
|
||||
my_well_formed_len_gb2312(CHARSET_INFO *cs __attribute__((unused)),
|
||||
const char *b, const char *e,
|
||||
uint pos, int *error)
|
||||
{
|
||||
const char *b0= b;
|
||||
const char *emb= e - 1; /* Last possible end of an MB character */
|
||||
|
||||
*error= 0;
|
||||
while (pos-- && b < e)
|
||||
{
|
||||
if ((uchar) b[0] < 128)
|
||||
{
|
||||
/* Single byte ascii character */
|
||||
b++;
|
||||
}
|
||||
else if (b < emb && isgb2312head(*b) && isgb2312tail(b[1]))
|
||||
{
|
||||
/* Double byte character */
|
||||
b+= 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Wrong byte sequence */
|
||||
*error= 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (uint) (b - b0);
|
||||
}
|
||||
|
||||
|
||||
static MY_COLLATION_HANDLER my_collation_ci_handler =
|
||||
{
|
||||
NULL, /* init */
|
||||
@ -5708,7 +5743,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
|
||||
mbcharlen_gb2312,
|
||||
my_numchars_mb,
|
||||
my_charpos_mb,
|
||||
my_well_formed_len_mb,
|
||||
my_well_formed_len_gb2312,
|
||||
my_lengthsp_8bit,
|
||||
my_numcells_8bit,
|
||||
my_mb_wc_gb2312, /* mb_wc */
|
||||
|
Loading…
x
Reference in New Issue
Block a user