Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge sql/mysqld.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_select.cc: Auto merged
This commit is contained in:
commit
e420488ee6
@ -6,6 +6,6 @@ path=`dirname $0`
|
|||||||
extra_flags="$pentium_cflags $debug_cflags $max_cflags"
|
extra_flags="$pentium_cflags $debug_cflags $max_cflags"
|
||||||
c_warnings="$c_warnings $debug_extra_warnings"
|
c_warnings="$c_warnings $debug_extra_warnings"
|
||||||
cxx_warnings="$cxx_warnings $debug_extra_warnings"
|
cxx_warnings="$cxx_warnings $debug_extra_warnings"
|
||||||
extra_configs="$pentium_configs $debug_configs $max_configs"
|
extra_configs="$pentium_configs $debug_configs $max_configs --with-experimental-collations"
|
||||||
|
|
||||||
. "$path/FINISH.sh"
|
. "$path/FINISH.sh"
|
||||||
|
@ -2529,7 +2529,8 @@ print_table_data_xml(MYSQL_RES *result)
|
|||||||
|
|
||||||
tee_fputs("<?xml version=\"1.0\"?>\n\n<resultset statement=\"", PAGER);
|
tee_fputs("<?xml version=\"1.0\"?>\n\n<resultset statement=\"", PAGER);
|
||||||
xmlencode_print(glob_buffer.ptr(), (int)strlen(glob_buffer.ptr()));
|
xmlencode_print(glob_buffer.ptr(), (int)strlen(glob_buffer.ptr()));
|
||||||
tee_fputs("\">", PAGER);
|
tee_fputs("\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">",
|
||||||
|
PAGER);
|
||||||
|
|
||||||
fields = mysql_fetch_fields(result);
|
fields = mysql_fetch_fields(result);
|
||||||
while ((cur = mysql_fetch_row(result)))
|
while ((cur = mysql_fetch_row(result)))
|
||||||
|
@ -429,3 +429,16 @@ then
|
|||||||
else
|
else
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Shall we build experimental collations
|
||||||
|
AC_ARG_WITH(experimental-collations,
|
||||||
|
[],
|
||||||
|
[with_exp_coll=$withval],
|
||||||
|
[with_exp_coll=no]
|
||||||
|
)
|
||||||
|
|
||||||
|
if test "$with_exp_coll" = "yes"
|
||||||
|
then
|
||||||
|
AC_DEFINE([HAVE_UTF8_GENERAL_CS], [1], [certain Japanese customer])
|
||||||
|
fi
|
||||||
|
@ -7,7 +7,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
<resultset statement="select * from t1
|
<resultset statement="select * from t1
|
||||||
">
|
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<row>
|
<row>
|
||||||
<field name="a&b">1</field>
|
<field name="a&b">1</field>
|
||||||
<field name="a<b">2</field>
|
<field name="a<b">2</field>
|
||||||
@ -34,7 +34,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
<resultset statement="select count(*) from t1
|
<resultset statement="select count(*) from t1
|
||||||
">
|
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<row>
|
<row>
|
||||||
<field name="count(*)">1</field>
|
<field name="count(*)">1</field>
|
||||||
</row>
|
</row>
|
||||||
@ -42,7 +42,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
<resultset statement="select 1 < 2 from dual
|
<resultset statement="select 1 < 2 from dual
|
||||||
">
|
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<row>
|
<row>
|
||||||
<field name="1 < 2">1</field>
|
<field name="1 < 2">1</field>
|
||||||
</row>
|
</row>
|
||||||
@ -50,7 +50,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
<resultset statement="select 1 > 2 from dual
|
<resultset statement="select 1 > 2 from dual
|
||||||
">
|
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<row>
|
<row>
|
||||||
<field name="1 > 2">0</field>
|
<field name="1 > 2">0</field>
|
||||||
</row>
|
</row>
|
||||||
@ -58,7 +58,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
<resultset statement="select 1 & 3 from dual
|
<resultset statement="select 1 & 3 from dual
|
||||||
">
|
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<row>
|
<row>
|
||||||
<field name="1 & 3">1</field>
|
<field name="1 & 3">1</field>
|
||||||
</row>
|
</row>
|
||||||
@ -66,7 +66,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
<resultset statement="select null from dual
|
<resultset statement="select null from dual
|
||||||
">
|
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<row>
|
<row>
|
||||||
<field name="NULL" xsi:nil="true" />
|
<field name="NULL" xsi:nil="true" />
|
||||||
</row>
|
</row>
|
||||||
|
@ -2654,3 +2654,12 @@ ii 2 ii 2 İİ 4
|
|||||||
İİ 4 ii 2 İİ 4
|
İİ 4 ii 2 İİ 4
|
||||||
II 2 ıı 4 II 2
|
II 2 ıı 4 II 2
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
c1 text character set ucs2 collate ucs2_polish_ci NOT NULL
|
||||||
|
) ENGINE=MyISAM;
|
||||||
|
insert into t1 values (''),('a');
|
||||||
|
SELECT COUNT(*), c1 FROM t1 GROUP BY c1;
|
||||||
|
COUNT(*) c1
|
||||||
|
1
|
||||||
|
1 a
|
||||||
|
DROP TABLE IF EXISTS t1;
|
||||||
|
@ -18,6 +18,29 @@ create table t2 like t1;
|
|||||||
load data local infile 'MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2;
|
load data local infile 'MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2;
|
||||||
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
|
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
|
||||||
id i r1 r2 p id i r1 r2 p
|
id i r1 r2 p id i r1 r2 p
|
||||||
stop slave;
|
|
||||||
drop table t1;
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
DROP TABLE IF EXISTS t1;
|
||||||
|
CREATE TABLE t1 (col_a double default NULL);
|
||||||
|
CREATE PROCEDURE test_replication_sp1()
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO t1 VALUES (rand()), (rand());
|
||||||
|
INSERT INTO t1 VALUES (rand());
|
||||||
|
END|
|
||||||
|
CREATE PROCEDURE test_replication_sp2()
|
||||||
|
BEGIN
|
||||||
|
CALL test_replication_sp1();
|
||||||
|
CALL test_replication_sp1();
|
||||||
|
END|
|
||||||
|
CREATE FUNCTION test_replication_sf() RETURNS DOUBLE DETERMINISTIC
|
||||||
|
BEGIN
|
||||||
|
RETURN (rand() + rand());
|
||||||
|
END|
|
||||||
|
CALL test_replication_sp1();
|
||||||
|
CALL test_replication_sp2();
|
||||||
|
INSERT INTO t1 VALUES (test_replication_sf());
|
||||||
|
INSERT INTO t1 VALUES (test_replication_sf());
|
||||||
|
INSERT INTO t1 VALUES (test_replication_sf());
|
||||||
|
DROP PROCEDURE IF EXISTS test_replication_sp1;
|
||||||
|
DROP PROCEDURE IF EXISTS test_replication_sp2;
|
||||||
|
DROP FUNCTION IF EXISTS test_replication_sf;
|
||||||
|
DROP TABLE IF EXISTS t1;
|
||||||
|
@ -475,3 +475,13 @@ ALTER TABLE t1 MODIFY a VARCHAR(30) character set utf8 collate utf8_turkish_ci;
|
|||||||
SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
|
SELECT a, length(a) la, @l:=lower(a) l, length(@l) ll, @u:=upper(a) u, length(@u) lu
|
||||||
FROM t1 ORDER BY id;
|
FROM t1 ORDER BY id;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #27079 Crash while grouping empty ucs2 strings
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
c1 text character set ucs2 collate ucs2_polish_ci NOT NULL
|
||||||
|
) ENGINE=MyISAM;
|
||||||
|
insert into t1 values (''),('a');
|
||||||
|
SELECT COUNT(*), c1 FROM t1 GROUP BY c1;
|
||||||
|
DROP TABLE IF EXISTS t1;
|
||||||
|
@ -28,10 +28,76 @@ create table t2 like t1;
|
|||||||
eval load data local infile '$MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2;
|
eval load data local infile '$MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2;
|
||||||
# compare them with the replica; the SELECT below should return no row
|
# compare them with the replica; the SELECT below should return no row
|
||||||
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
|
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
|
||||||
stop slave;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
# End of 4.1 tests
|
# End of 4.1 tests
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#25543 test calling rand() multiple times on the master in
|
||||||
|
# a stored procedure.
|
||||||
|
#
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS t1;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
CREATE TABLE t1 (col_a double default NULL);
|
||||||
|
|
||||||
|
DELIMITER |;
|
||||||
|
|
||||||
|
# Use a SP that calls rand() multiple times
|
||||||
|
CREATE PROCEDURE test_replication_sp1()
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO t1 VALUES (rand()), (rand());
|
||||||
|
INSERT INTO t1 VALUES (rand());
|
||||||
|
END|
|
||||||
|
|
||||||
|
# Use a SP that calls another SP to call rand() multiple times
|
||||||
|
CREATE PROCEDURE test_replication_sp2()
|
||||||
|
BEGIN
|
||||||
|
CALL test_replication_sp1();
|
||||||
|
CALL test_replication_sp1();
|
||||||
|
END|
|
||||||
|
|
||||||
|
# Use a SF that calls rand() multiple times
|
||||||
|
CREATE FUNCTION test_replication_sf() RETURNS DOUBLE DETERMINISTIC
|
||||||
|
BEGIN
|
||||||
|
RETURN (rand() + rand());
|
||||||
|
END|
|
||||||
|
|
||||||
|
DELIMITER ;|
|
||||||
|
|
||||||
|
# Exercise the functions and procedures then compare the results on
|
||||||
|
# the master to those on the slave.
|
||||||
|
CALL test_replication_sp1();
|
||||||
|
CALL test_replication_sp2();
|
||||||
|
INSERT INTO t1 VALUES (test_replication_sf());
|
||||||
|
INSERT INTO t1 VALUES (test_replication_sf());
|
||||||
|
INSERT INTO t1 VALUES (test_replication_sf());
|
||||||
|
|
||||||
|
# Record the results of the query on the master
|
||||||
|
--exec $MYSQL --port=$MASTER_MYPORT test -e "SELECT * FROM test.t1" > $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql
|
||||||
|
|
||||||
|
--sync_slave_with_master
|
||||||
|
|
||||||
|
# Record the results of the query on the slave
|
||||||
|
--exec $MYSQL --port=$SLAVE_MYPORT test -e "SELECT * FROM test.t1" > $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
|
||||||
|
|
||||||
|
# Compare the results from the master to the slave.
|
||||||
|
--exec diff $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
connection master;
|
||||||
|
--disable_warnings
|
||||||
|
DROP PROCEDURE IF EXISTS test_replication_sp1;
|
||||||
|
DROP PROCEDURE IF EXISTS test_replication_sp2;
|
||||||
|
DROP FUNCTION IF EXISTS test_replication_sf;
|
||||||
|
DROP TABLE IF EXISTS t1;
|
||||||
|
--enable_warnings
|
||||||
|
--sync_slave_with_master
|
||||||
|
|
||||||
|
# If all is good, when can cleanup our dump files.
|
||||||
|
--system rm $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql
|
||||||
|
--system rm $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
|
||||||
|
@ -544,7 +544,7 @@ TABLE_LIST *mysql_lock_have_duplicate(THD *thd, TABLE_LIST *needle,
|
|||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
/* A temporary table does not have locks. */
|
/* A temporary table does not have locks. */
|
||||||
if (table->s->tmp_table == TMP_TABLE)
|
if (table->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
/* Get command lock or LOCK TABLES lock. Maybe empty for INSERT DELAYED. */
|
/* Get command lock or LOCK TABLES lock. Maybe empty for INSERT DELAYED. */
|
||||||
@ -569,7 +569,7 @@ TABLE_LIST *mysql_lock_have_duplicate(THD *thd, TABLE_LIST *needle,
|
|||||||
if (haystack->placeholder())
|
if (haystack->placeholder())
|
||||||
continue;
|
continue;
|
||||||
table2= haystack->table;
|
table2= haystack->table;
|
||||||
if (table2->s->tmp_table == TMP_TABLE)
|
if (table2->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* All tables in list must be in lock. */
|
/* All tables in list must be in lock. */
|
||||||
@ -655,7 +655,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count,
|
|||||||
*write_lock_used=0;
|
*write_lock_used=0;
|
||||||
for (i=tables=lock_count=0 ; i < count ; i++)
|
for (i=tables=lock_count=0 ; i < count ; i++)
|
||||||
{
|
{
|
||||||
if (table_ptr[i]->s->tmp_table != TMP_TABLE)
|
if (table_ptr[i]->s->tmp_table != NON_TRANSACTIONAL_TMP_TABLE)
|
||||||
{
|
{
|
||||||
tables+=table_ptr[i]->file->lock_count();
|
tables+=table_ptr[i]->file->lock_count();
|
||||||
lock_count++;
|
lock_count++;
|
||||||
@ -697,7 +697,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count,
|
|||||||
TABLE *table;
|
TABLE *table;
|
||||||
enum thr_lock_type lock_type;
|
enum thr_lock_type lock_type;
|
||||||
|
|
||||||
if ((table=table_ptr[i])->s->tmp_table == TMP_TABLE)
|
if ((table=table_ptr[i])->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE)
|
||||||
continue;
|
continue;
|
||||||
lock_type= table->reginfo.lock_type;
|
lock_type= table->reginfo.lock_type;
|
||||||
if (lock_type >= TL_WRITE_ALLOW_WRITE)
|
if (lock_type >= TL_WRITE_ALLOW_WRITE)
|
||||||
|
@ -6126,12 +6126,12 @@ The minimum value for this variable is 4096.",
|
|||||||
(gptr*) &max_system_variables.tmp_table_size, 0, GET_ULL,
|
(gptr*) &max_system_variables.tmp_table_size, 0, GET_ULL,
|
||||||
REQUIRED_ARG, 32*1024*1024L, 1024, MAX_MEM_TABLE_SIZE, 0, 1, 0},
|
REQUIRED_ARG, 32*1024*1024L, 1024, MAX_MEM_TABLE_SIZE, 0, 1, 0},
|
||||||
{"transaction_alloc_block_size", OPT_TRANS_ALLOC_BLOCK_SIZE,
|
{"transaction_alloc_block_size", OPT_TRANS_ALLOC_BLOCK_SIZE,
|
||||||
"Allocation block size for transactions to be stored in binary log",
|
"Allocation block size for various transaction-related structures",
|
||||||
(gptr*) &global_system_variables.trans_alloc_block_size,
|
(gptr*) &global_system_variables.trans_alloc_block_size,
|
||||||
(gptr*) &max_system_variables.trans_alloc_block_size, 0, GET_ULONG,
|
(gptr*) &max_system_variables.trans_alloc_block_size, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ~0L, 0, 1024, 0},
|
REQUIRED_ARG, QUERY_ALLOC_BLOCK_SIZE, 1024, ~0L, 0, 1024, 0},
|
||||||
{"transaction_prealloc_size", OPT_TRANS_PREALLOC_SIZE,
|
{"transaction_prealloc_size", OPT_TRANS_PREALLOC_SIZE,
|
||||||
"Persistent buffer for transactions to be stored in binary log",
|
"Persistent buffer for various transaction-related structures",
|
||||||
(gptr*) &global_system_variables.trans_prealloc_size,
|
(gptr*) &global_system_variables.trans_prealloc_size,
|
||||||
(gptr*) &max_system_variables.trans_prealloc_size, 0, GET_ULONG,
|
(gptr*) &max_system_variables.trans_prealloc_size, 0, GET_ULONG,
|
||||||
REQUIRED_ARG, TRANS_ALLOC_PREALLOC_SIZE, 1024, ~0L, 0, 1024, 0},
|
REQUIRED_ARG, TRANS_ALLOC_PREALLOC_SIZE, 1024, ~0L, 0, 1024, 0},
|
||||||
|
@ -2950,7 +2950,7 @@ TABLE *open_temporary_table(THD *thd, const char *path, const char *db,
|
|||||||
share= tmp_table->s;
|
share= tmp_table->s;
|
||||||
tmp_table->reginfo.lock_type=TL_WRITE; // Simulate locked
|
tmp_table->reginfo.lock_type=TL_WRITE; // Simulate locked
|
||||||
share->tmp_table= (tmp_table->file->has_transactions() ?
|
share->tmp_table= (tmp_table->file->has_transactions() ?
|
||||||
TRANSACTIONAL_TMP_TABLE : TMP_TABLE);
|
TRANSACTIONAL_TMP_TABLE : NON_TRANSACTIONAL_TMP_TABLE);
|
||||||
share->table_cache_key= (char*) (tmp_table+1);
|
share->table_cache_key= (char*) (tmp_table+1);
|
||||||
share->db= share->table_cache_key;
|
share->db= share->table_cache_key;
|
||||||
share->key_length= (uint) (strmov(((char*) (share->table_name=
|
share->key_length= (uint) (strmov(((char*) (share->table_name=
|
||||||
|
@ -613,6 +613,18 @@ void THD::cleanup_after_query()
|
|||||||
clear_next_insert_id= 0;
|
clear_next_insert_id= 0;
|
||||||
next_insert_id= 0;
|
next_insert_id= 0;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
Reset rand_used so that detection of calls to rand() will save random
|
||||||
|
seeds if needed by the slave.
|
||||||
|
|
||||||
|
Do not reset rand_used if inside a stored function or trigger because
|
||||||
|
only the call to these operations is logged. Thus only the calling
|
||||||
|
statement needs to detect rand() calls made by its substatements. These
|
||||||
|
substatements must not set rand_used to 0 because it would remove the
|
||||||
|
detection of rand() by the calling statement.
|
||||||
|
*/
|
||||||
|
if (!in_sub_stmt)
|
||||||
|
rand_used= 0;
|
||||||
/* Free Items that were created during this execution */
|
/* Free Items that were created during this execution */
|
||||||
free_items();
|
free_items();
|
||||||
/* Reset where. */
|
/* Reset where. */
|
||||||
|
@ -179,7 +179,7 @@ exit:
|
|||||||
orig_table_list->table_name= (char*) table->s->table_name;
|
orig_table_list->table_name= (char*) table->s->table_name;
|
||||||
orig_table_list->table_name_length= strlen((char*)table->s->table_name);
|
orig_table_list->table_name_length= strlen((char*)table->s->table_name);
|
||||||
table->derived_select_number= first_select->select_number;
|
table->derived_select_number= first_select->select_number;
|
||||||
table->s->tmp_table= TMP_TABLE;
|
table->s->tmp_table= NON_TRANSACTIONAL_TMP_TABLE;
|
||||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||||
if (orig_table_list->referencing_view)
|
if (orig_table_list->referencing_view)
|
||||||
table->grant= orig_table_list->grant;
|
table->grant= orig_table_list->grant;
|
||||||
|
@ -9170,7 +9170,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
|
|||||||
table->s->table_name= table->s->path= tmpname;
|
table->s->table_name= table->s->path= tmpname;
|
||||||
table->s->db= "";
|
table->s->db= "";
|
||||||
table->s->blob_ptr_size= mi_portable_sizeof_char_ptr;
|
table->s->blob_ptr_size= mi_portable_sizeof_char_ptr;
|
||||||
table->s->tmp_table= TMP_TABLE;
|
table->s->tmp_table= NON_TRANSACTIONAL_TMP_TABLE;
|
||||||
table->s->db_low_byte_first=1; // True for HEAP and MyISAM
|
table->s->db_low_byte_first=1; // True for HEAP and MyISAM
|
||||||
table->s->table_charset= param->table_charset;
|
table->s->table_charset= param->table_charset;
|
||||||
table->s->keys_for_keyread.init();
|
table->s->keys_for_keyread.init();
|
||||||
|
@ -55,7 +55,8 @@ typedef struct st_grant_info
|
|||||||
ulong orig_want_privilege;
|
ulong orig_want_privilege;
|
||||||
} GRANT_INFO;
|
} GRANT_INFO;
|
||||||
|
|
||||||
enum tmp_table_type {NO_TMP_TABLE=0, TMP_TABLE=1, TRANSACTIONAL_TMP_TABLE=2,
|
enum tmp_table_type {NO_TMP_TABLE=0,
|
||||||
|
NON_TRANSACTIONAL_TMP_TABLE=1, TRANSACTIONAL_TMP_TABLE=2,
|
||||||
SYSTEM_TMP_TABLE=3};
|
SYSTEM_TMP_TABLE=3};
|
||||||
|
|
||||||
enum frm_type_enum
|
enum frm_type_enum
|
||||||
|
@ -6744,7 +6744,7 @@ typedef struct my_uca_scanner_handler_st
|
|||||||
int (*next)(my_uca_scanner *scanner);
|
int (*next)(my_uca_scanner *scanner);
|
||||||
} my_uca_scanner_handler;
|
} my_uca_scanner_handler;
|
||||||
|
|
||||||
static uint16 nochar[]= {0};
|
static uint16 nochar[]= {0,0};
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_CHARSET_ucs2
|
#ifdef HAVE_CHARSET_ucs2
|
||||||
@ -6769,13 +6769,32 @@ static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner,
|
|||||||
CHARSET_INFO *cs __attribute__((unused)),
|
CHARSET_INFO *cs __attribute__((unused)),
|
||||||
const uchar *str, uint length)
|
const uchar *str, uint length)
|
||||||
{
|
{
|
||||||
/* Note, no needs to initialize scanner->wbeg */
|
scanner->wbeg= nochar;
|
||||||
|
if (length)
|
||||||
|
{
|
||||||
scanner->sbeg= str;
|
scanner->sbeg= str;
|
||||||
scanner->send= str + length - 2;
|
scanner->send= str + length - 2;
|
||||||
scanner->wbeg= nochar;
|
|
||||||
scanner->uca_length= cs->sort_order;
|
scanner->uca_length= cs->sort_order;
|
||||||
scanner->uca_weight= cs->sort_order_big;
|
scanner->uca_weight= cs->sort_order_big;
|
||||||
scanner->contractions= cs->contractions;
|
scanner->contractions= cs->contractions;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Sometimes this function is called with
|
||||||
|
str=NULL and length=0, which should be
|
||||||
|
considered as an empty string.
|
||||||
|
|
||||||
|
The above initialization is unsafe for such cases,
|
||||||
|
because scanner->send is initialized to (NULL-2), which is 0xFFFFFFFE.
|
||||||
|
Then we fall into an endless loop in my_uca_scanner_next_ucs2().
|
||||||
|
|
||||||
|
Do special initialization for the case when length=0.
|
||||||
|
Initialize scanner->sbeg to an address greater than scanner->send.
|
||||||
|
Next call of my_uca_scanner_next_ucs2() will correctly return with -1.
|
||||||
|
*/
|
||||||
|
scanner->sbeg= (uchar*) &nochar[1];
|
||||||
|
scanner->send= (uchar*) &nochar[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2764,6 +2764,7 @@ static int my_strnncoll_utf8_cs(CHARSET_INFO *cs,
|
|||||||
const uchar *te=t+tlen;
|
const uchar *te=t+tlen;
|
||||||
int save_diff = 0;
|
int save_diff = 0;
|
||||||
int diff;
|
int diff;
|
||||||
|
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
|
||||||
|
|
||||||
while ( s < se && t < te )
|
while ( s < se && t < te )
|
||||||
{
|
{
|
||||||
@ -2800,13 +2801,16 @@ static int my_strnncoll_utf8_cs(CHARSET_INFO *cs,
|
|||||||
|
|
||||||
static int my_strnncollsp_utf8_cs(CHARSET_INFO *cs,
|
static int my_strnncollsp_utf8_cs(CHARSET_INFO *cs,
|
||||||
const uchar *s, uint slen,
|
const uchar *s, uint slen,
|
||||||
const uchar *t, uint tlen)
|
const uchar *t, uint tlen,
|
||||||
|
my_bool diff_if_only_endspace_difference
|
||||||
|
__attribute__((unused)))
|
||||||
{
|
{
|
||||||
int s_res,t_res;
|
int s_res,t_res;
|
||||||
my_wc_t s_wc,t_wc;
|
my_wc_t s_wc,t_wc;
|
||||||
const uchar *se= s+slen;
|
const uchar *se= s+slen;
|
||||||
const uchar *te= t+tlen;
|
const uchar *te= t+tlen;
|
||||||
int save_diff = 0;
|
int save_diff = 0;
|
||||||
|
MY_UNICASE_INFO **uni_plane= cs->caseinfo;
|
||||||
|
|
||||||
while ( s < se && t < te )
|
while ( s < se && t < te )
|
||||||
{
|
{
|
||||||
@ -2875,6 +2879,7 @@ static MY_COLLATION_HANDLER my_collation_cs_handler =
|
|||||||
my_strnncoll_utf8_cs,
|
my_strnncoll_utf8_cs,
|
||||||
my_strnncollsp_utf8_cs,
|
my_strnncollsp_utf8_cs,
|
||||||
my_strnxfrm_utf8,
|
my_strnxfrm_utf8,
|
||||||
|
my_strnxfrmlen_utf8,
|
||||||
my_like_range_simple,
|
my_like_range_simple,
|
||||||
my_wildcmp_mb,
|
my_wildcmp_mb,
|
||||||
my_strcasecmp_utf8,
|
my_strcasecmp_utf8,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user