Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into poseidon.ndb.mysql.com:/home/tomas/mysql-4.1
This commit is contained in:
commit
957312eeb5
@ -20,14 +20,20 @@ if [ "$BK_STATUS" = OK ]
|
|||||||
then
|
then
|
||||||
|
|
||||||
CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet`
|
CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet`
|
||||||
BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/ BUG#\1/p'`
|
BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/\1/p'`
|
||||||
WL=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Ww][Ll] *# *\([0-9][0-9]*\).*$/ WL#\1/p'`
|
WL=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Ww][Ll] *# *\([0-9][0-9]*\).*$/ WL#\1/p'`
|
||||||
|
|
||||||
if [ "$BUG" = "" ]
|
if [ "$BUG" = "" ]
|
||||||
then
|
then
|
||||||
TO=dev-public@mysql.com
|
TO=dev-public@mysql.com
|
||||||
|
BS=""
|
||||||
|
BH=""
|
||||||
else
|
else
|
||||||
TO=dev-bugs@mysql.com
|
TO=dev-bugs@mysql.com
|
||||||
|
BS=" BUG#$BUG"
|
||||||
|
# need newline here
|
||||||
|
BH="X-Bug: $BUG
|
||||||
|
"
|
||||||
fi
|
fi
|
||||||
#++
|
#++
|
||||||
# dev-public@ / dev-bugs@
|
# dev-public@ / dev-bugs@
|
||||||
@ -38,8 +44,8 @@ fi
|
|||||||
List-ID: <bk.mysql-$VERSION>
|
List-ID: <bk.mysql-$VERSION>
|
||||||
From: $FROM
|
From: $FROM
|
||||||
To: $TO
|
To: $TO
|
||||||
Subject: bk commit - $VERSION tree ($CHANGESET)${BUG}${WL}
|
Subject: bk commit - $VERSION tree ($CHANGESET)${BS}${WL}
|
||||||
|
$BH
|
||||||
EOF
|
EOF
|
||||||
bk changes -v -r+
|
bk changes -v -r+
|
||||||
bk cset -r+ -d
|
bk cset -r+ -d
|
||||||
@ -54,14 +60,14 @@ EOF
|
|||||||
List-ID: <bk.mysql-$VERSION>
|
List-ID: <bk.mysql-$VERSION>
|
||||||
From: $FROM
|
From: $FROM
|
||||||
To: $INTERNALS
|
To: $INTERNALS
|
||||||
Subject: bk commit into $VERSION tree ($CHANGESET)
|
Subject: bk commit into $VERSION tree ($CHANGESET)$BS
|
||||||
|
$BH
|
||||||
Below is the list of changes that have just been committed into a local
|
Below is the list of changes that have just been committed into a local
|
||||||
$VERSION repository of $USER. When $USER does a push these changes will
|
$VERSION repository of $USER. When $USER does a push these changes will
|
||||||
be propagated to the main repository and, within 24 hours after the
|
be propagated to the main repository and, within 24 hours after the
|
||||||
push, to the public repository.
|
push, to the public repository.
|
||||||
For information on how to access the public repository
|
For information on how to access the public repository
|
||||||
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
|
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
bk changes -v -r+
|
bk changes -v -r+
|
||||||
@ -81,7 +87,7 @@ EOF
|
|||||||
List-ID: <bk.mysql-$VERSION>
|
List-ID: <bk.mysql-$VERSION>
|
||||||
From: $FROM
|
From: $FROM
|
||||||
To: $DOCS
|
To: $DOCS
|
||||||
Subject: bk commit - $VERSION tree (Manual) ($CHANGESET)
|
Subject: bk commit - $VERSION tree (Manual) ($CHANGESET)$BS
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
bk changes -v -r+
|
bk changes -v -r+
|
||||||
|
@ -806,7 +806,7 @@ sub find
|
|||||||
sub rm_all
|
sub rm_all
|
||||||
{
|
{
|
||||||
my(@rm_files)=@_;
|
my(@rm_files)=@_;
|
||||||
my($dir,$current_dir,@files,@dirs);
|
my($dir,$current_dir,@files,@dirs,$removed);
|
||||||
$current_dir = `pwd`; chomp($current_dir);
|
$current_dir = `pwd`; chomp($current_dir);
|
||||||
|
|
||||||
foreach $dir (@rm_files)
|
foreach $dir (@rm_files)
|
||||||
@ -830,7 +830,9 @@ sub rm_all
|
|||||||
}
|
}
|
||||||
if ($#files >= 0)
|
if ($#files >= 0)
|
||||||
{
|
{
|
||||||
system("rm -f " . join(" ",@files)) && abort("Can't remove files from $dir");
|
$removed= unlink @files;
|
||||||
|
print "rm_all : removed $removed files in $current_dir/$dir\n" if ($opt_debug);
|
||||||
|
abort("Can't remove all $#files+1 from $current_dir/$dir, just $removed") if $removed != $#files+1;
|
||||||
}
|
}
|
||||||
foreach $dir (@dirs)
|
foreach $dir (@dirs)
|
||||||
{
|
{
|
||||||
|
@ -66,18 +66,18 @@ LINK32=link.exe
|
|||||||
# PROP Output_Dir ".\Release"
|
# PROP Output_Dir ".\Release"
|
||||||
# PROP Intermediate_Dir ".\Release"
|
# PROP Intermediate_Dir ".\Release"
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
|
# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
|
||||||
# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
|
# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
|
||||||
# ADD BASE MTL /nologo /tlb".\Release\client_test.tlb" /win32
|
# ADD BASE MTL /nologo /tlb".\Release\mysql_client_test.tlb" /win32
|
||||||
# ADD MTL /nologo /tlb".\Release\client_test.tlb" /win32
|
# ADD MTL /nologo /tlb".\Release\mysql_client_test.tlb" /win32
|
||||||
# ADD BASE RSC /l 1033
|
# ADD BASE RSC /l 1033
|
||||||
# ADD RSC /l 1033
|
# ADD RSC /l 1033
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
# ADD BASE BSC32 /nologo
|
# ADD BASE BSC32 /nologo
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\client_test.exe" /incremental:no /pdb:".\Release\client_test.pdb" /pdbtype:sept /subsystem:console
|
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console
|
||||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\client_test.exe" /incremental:no /pdb:".\Release\client_test.pdb" /pdbtype:sept /subsystem:console
|
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
|
@ -376,8 +376,8 @@ static REP_SET *make_new_set(REP_SETS *sets);
|
|||||||
static void make_sets_invisible(REP_SETS *sets);
|
static void make_sets_invisible(REP_SETS *sets);
|
||||||
static void free_last_set(REP_SETS *sets);
|
static void free_last_set(REP_SETS *sets);
|
||||||
static void free_sets(REP_SETS *sets);
|
static void free_sets(REP_SETS *sets);
|
||||||
static void set_bit(REP_SET *set, uint bit);
|
static void internal_set_bit(REP_SET *set, uint bit);
|
||||||
static void clear_bit(REP_SET *set, uint bit);
|
static void internal_clear_bit(REP_SET *set, uint bit);
|
||||||
static void or_bits(REP_SET *to,REP_SET *from);
|
static void or_bits(REP_SET *to,REP_SET *from);
|
||||||
static void copy_bits(REP_SET *to,REP_SET *from);
|
static void copy_bits(REP_SET *to,REP_SET *from);
|
||||||
static int cmp_bits(REP_SET *set1,REP_SET *set2);
|
static int cmp_bits(REP_SET *set1,REP_SET *set2);
|
||||||
@ -454,7 +454,7 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
|
|||||||
{
|
{
|
||||||
if (from[i][0] == '\\' && from[i][1] == '^')
|
if (from[i][0] == '\\' && from[i][1] == '^')
|
||||||
{
|
{
|
||||||
set_bit(start_states,states+1);
|
internal_set_bit(start_states,states+1);
|
||||||
if (!from[i][2])
|
if (!from[i][2])
|
||||||
{
|
{
|
||||||
start_states->table_offset=i;
|
start_states->table_offset=i;
|
||||||
@ -463,8 +463,8 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
|
|||||||
}
|
}
|
||||||
else if (from[i][0] == '\\' && from[i][1] == '$')
|
else if (from[i][0] == '\\' && from[i][1] == '$')
|
||||||
{
|
{
|
||||||
set_bit(start_states,states);
|
internal_set_bit(start_states,states);
|
||||||
set_bit(word_states,states);
|
internal_set_bit(word_states,states);
|
||||||
if (!from[i][2] && start_states->table_offset == (uint) ~0)
|
if (!from[i][2] && start_states->table_offset == (uint) ~0)
|
||||||
{
|
{
|
||||||
start_states->table_offset=i;
|
start_states->table_offset=i;
|
||||||
@ -473,11 +473,11 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
set_bit(word_states,states);
|
internal_set_bit(word_states,states);
|
||||||
if (from[i][0] == '\\' && (from[i][1] == 'b' && from[i][2]))
|
if (from[i][0] == '\\' && (from[i][1] == 'b' && from[i][2]))
|
||||||
set_bit(start_states,states+1);
|
internal_set_bit(start_states,states+1);
|
||||||
else
|
else
|
||||||
set_bit(start_states,states);
|
internal_set_bit(start_states,states);
|
||||||
}
|
}
|
||||||
for (pos=from[i], len=0; *pos ; pos++)
|
for (pos=from[i], len=0; *pos ; pos++)
|
||||||
{
|
{
|
||||||
@ -583,9 +583,9 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
|
|||||||
follow[i].len > found_end)
|
follow[i].len > found_end)
|
||||||
found_end=follow[i].len;
|
found_end=follow[i].len;
|
||||||
if (chr && follow[i].chr)
|
if (chr && follow[i].chr)
|
||||||
set_bit(new_set,i+1); /* To next set */
|
internal_set_bit(new_set,i+1); /* To next set */
|
||||||
else
|
else
|
||||||
set_bit(new_set,i);
|
internal_set_bit(new_set,i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (found_end)
|
if (found_end)
|
||||||
@ -602,7 +602,7 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
|
|||||||
if (follow[bit_nr-1].len < found_end ||
|
if (follow[bit_nr-1].len < found_end ||
|
||||||
(new_set->found_len &&
|
(new_set->found_len &&
|
||||||
(chr == 0 || !follow[bit_nr].chr)))
|
(chr == 0 || !follow[bit_nr].chr)))
|
||||||
clear_bit(new_set,i);
|
internal_clear_bit(new_set,i);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (chr == 0 || !follow[bit_nr].chr)
|
if (chr == 0 || !follow[bit_nr].chr)
|
||||||
@ -751,13 +751,13 @@ static void free_sets(REP_SETS *sets)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_bit(REP_SET *set, uint bit)
|
static void internal_set_bit(REP_SET *set, uint bit)
|
||||||
{
|
{
|
||||||
set->bits[bit / WORD_BIT] |= 1 << (bit % WORD_BIT);
|
set->bits[bit / WORD_BIT] |= 1 << (bit % WORD_BIT);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void clear_bit(REP_SET *set, uint bit)
|
static void internal_clear_bit(REP_SET *set, uint bit)
|
||||||
{
|
{
|
||||||
set->bits[bit / WORD_BIT] &= ~ (1 << (bit % WORD_BIT));
|
set->bits[bit / WORD_BIT] &= ~ (1 << (bit % WORD_BIT));
|
||||||
return;
|
return;
|
||||||
|
@ -637,7 +637,7 @@ extern int pthread_dummy(int);
|
|||||||
MySQL can survive with 32K, but some glibc libraries require > 128K stack
|
MySQL can survive with 32K, but some glibc libraries require > 128K stack
|
||||||
To resolve hostnames
|
To resolve hostnames
|
||||||
*/
|
*/
|
||||||
#define DEFAULT_THREAD_STACK (192*1024L)
|
#define DEFAULT_THREAD_STACK (256*1024L)
|
||||||
#else
|
#else
|
||||||
#define DEFAULT_THREAD_STACK (192*1024)
|
#define DEFAULT_THREAD_STACK (192*1024)
|
||||||
#endif
|
#endif
|
||||||
|
@ -417,7 +417,7 @@ row_create_prebuilt(
|
|||||||
prebuilt->sel_graph = NULL;
|
prebuilt->sel_graph = NULL;
|
||||||
|
|
||||||
prebuilt->search_tuple = dtuple_create(heap,
|
prebuilt->search_tuple = dtuple_create(heap,
|
||||||
dict_table_get_n_cols(table));
|
2 * dict_table_get_n_cols(table));
|
||||||
|
|
||||||
clust_index = dict_table_get_first_index(table);
|
clust_index = dict_table_get_first_index(table);
|
||||||
|
|
||||||
|
@ -1788,6 +1788,18 @@ static my_bool my_realloc_str(NET *net, ulong length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Clear possible error statee of struct NET */
|
||||||
|
|
||||||
|
static void net_clear_error(NET *net)
|
||||||
|
{
|
||||||
|
if (net->last_errno)
|
||||||
|
{
|
||||||
|
net->last_errno= 0;
|
||||||
|
net->last_error[0]= '\0';
|
||||||
|
strmov(net->sqlstate, not_error_sqlstate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Set statement error code, sqlstate, and error message
|
Set statement error code, sqlstate, and error message
|
||||||
from given errcode and sqlstate.
|
from given errcode and sqlstate.
|
||||||
@ -2467,6 +2479,11 @@ int cli_stmt_execute(MYSQL_STMT *stmt)
|
|||||||
set_stmt_error(stmt, CR_PARAMS_NOT_BOUND, unknown_sqlstate);
|
set_stmt_error(stmt, CR_PARAMS_NOT_BOUND, unknown_sqlstate);
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
|
if (stmt->mysql->status != MYSQL_STATUS_READY)
|
||||||
|
{
|
||||||
|
set_stmt_error(stmt, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate);
|
||||||
|
DBUG_RETURN(1);
|
||||||
|
}
|
||||||
|
|
||||||
net_clear(net); /* Sets net->write_pos */
|
net_clear(net); /* Sets net->write_pos */
|
||||||
/* Reserve place for null-marker bytes */
|
/* Reserve place for null-marker bytes */
|
||||||
@ -4501,6 +4518,11 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
|
|||||||
if (mysql)
|
if (mysql)
|
||||||
{
|
{
|
||||||
mysql->stmts= list_delete(mysql->stmts, &stmt->list);
|
mysql->stmts= list_delete(mysql->stmts, &stmt->list);
|
||||||
|
/*
|
||||||
|
Clear NET error state: if the following commands come through
|
||||||
|
successfully, connection will still be usable for other commands.
|
||||||
|
*/
|
||||||
|
net_clear_error(&mysql->net);
|
||||||
if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE)
|
if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE)
|
||||||
{
|
{
|
||||||
char buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */
|
char buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */
|
||||||
|
@ -71,9 +71,11 @@ void Querycache_stream::store_int(uint i)
|
|||||||
cur_data+= 4;
|
cur_data+= 4;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
memcpy(cur_data, &i, rest_len);
|
char buf[4];
|
||||||
|
int4store(buf, i);
|
||||||
|
memcpy(cur_data, buf, rest_len);
|
||||||
use_next_block();
|
use_next_block();
|
||||||
memcpy(cur_data, ((byte*)&i)+rest_len, 4-rest_len);
|
memcpy(cur_data, buf+rest_len, 4-rest_len);
|
||||||
cur_data+= 4-rest_len;
|
cur_data+= 4-rest_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,10 +188,12 @@ uint Querycache_stream::load_int()
|
|||||||
cur_data+= 4;
|
cur_data+= 4;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
memcpy(&result, cur_data, rest_len);
|
char buf[4];
|
||||||
|
memcpy(buf, cur_data, rest_len);
|
||||||
use_next_block();
|
use_next_block();
|
||||||
memcpy(((byte*)&result)+rest_len, cur_data, 4-rest_len);
|
memcpy(buf+rest_len, cur_data, 4-rest_len);
|
||||||
cur_data+= 4-rest_len;
|
cur_data+= 4-rest_len;
|
||||||
|
result= uint4korr(buf);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -270,10 +274,10 @@ int Querycache_stream::load_column(MEM_ROOT *alloc, char** column)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
len--;
|
len--;
|
||||||
if (!(*column= (char *)alloc_root(alloc, len + 4 + 1)))
|
if (!(*column= (char *)alloc_root(alloc, len + sizeof(uint) + 1)))
|
||||||
return 1;
|
return 1;
|
||||||
int4store(*column, len);
|
*((uint*)*column)= len;
|
||||||
(*column)+= 4;
|
(*column)+= sizeof(uint);
|
||||||
load_str_only(*column, len);
|
load_str_only(*column, len);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
|
|||||||
/* Read the next block of index file into the preload buffer */
|
/* Read the next block of index file into the preload buffer */
|
||||||
if ((my_off_t) length > (key_file_length-pos))
|
if ((my_off_t) length > (key_file_length-pos))
|
||||||
length= (ulong) (key_file_length-pos);
|
length= (ulong) (key_file_length-pos);
|
||||||
if (my_pread(share->kfile, (byte*) buff, length, pos, MYF(MY_FAE)))
|
if (my_pread(share->kfile, (byte*) buff, length, pos, MYF(MY_FAE|MY_FNABP)))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
if (ignore_leaves)
|
if (ignore_leaves)
|
||||||
|
@ -613,3 +613,17 @@ ucs2_bin 00610009
|
|||||||
ucs2_bin 0061
|
ucs2_bin 0061
|
||||||
ucs2_bin 00610020
|
ucs2_bin 00610020
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
SET NAMES latin1;
|
||||||
|
SET collation_connection='ucs2_swedish_ci';
|
||||||
|
CREATE TABLE t1 (Field1 int(10) default '0');
|
||||||
|
INSERT INTO t1 VALUES ('-1');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
Field1
|
||||||
|
-1
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (Field1 int(10) unsigned default '0');
|
||||||
|
INSERT INTO t1 VALUES ('-1');
|
||||||
|
Warnings:
|
||||||
|
Warning 1265 Data truncated for column 'Field1' at row 1
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET NAMES latin1;
|
||||||
|
@ -190,7 +190,7 @@ insert into t3 select * from t4;
|
|||||||
explain select distinct t1.a from t1,t3 where t1.a=t3.a;
|
explain select distinct t1.a from t1,t3 where t1.a=t3.a;
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary
|
1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary
|
||||||
1 SIMPLE t3 ref a a 5 test.t1.a 10 Using where; Using index; Distinct
|
1 SIMPLE t3 ref a a 5 test.t1.a 11 Using where; Using index; Distinct
|
||||||
select distinct t1.a from t1,t3 where t1.a=t3.a;
|
select distinct t1.a from t1,t3 where t1.a=t3.a;
|
||||||
a
|
a
|
||||||
1
|
1
|
||||||
|
@ -74,15 +74,15 @@ Table Op Msg_type Msg_text
|
|||||||
test.t1 preload_keys status OK
|
test.t1 preload_keys status OK
|
||||||
show status like "key_read%";
|
show status like "key_read%";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Key_read_requests 0
|
Key_read_requests 581
|
||||||
Key_reads 0
|
Key_reads 581
|
||||||
select count(*) from t1 where b = 'test1';
|
select count(*) from t1 where b = 'test1';
|
||||||
count(*)
|
count(*)
|
||||||
4181
|
4181
|
||||||
show status like "key_read%";
|
show status like "key_read%";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Key_read_requests 217
|
Key_read_requests 798
|
||||||
Key_reads 45
|
Key_reads 581
|
||||||
flush tables;
|
flush tables;
|
||||||
flush status;
|
flush status;
|
||||||
show status like "key_read%";
|
show status like "key_read%";
|
||||||
@ -98,15 +98,15 @@ Table Op Msg_type Msg_text
|
|||||||
test.t1 preload_keys status OK
|
test.t1 preload_keys status OK
|
||||||
show status like "key_read%";
|
show status like "key_read%";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Key_read_requests 0
|
Key_read_requests 10
|
||||||
Key_reads 0
|
Key_reads 10
|
||||||
select count(*) from t1 where b = 'test1';
|
select count(*) from t1 where b = 'test1';
|
||||||
count(*)
|
count(*)
|
||||||
4181
|
4181
|
||||||
show status like "key_read%";
|
show status like "key_read%";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Key_read_requests 217
|
Key_read_requests 227
|
||||||
Key_reads 45
|
Key_reads 52
|
||||||
flush tables;
|
flush tables;
|
||||||
flush status;
|
flush status;
|
||||||
show status like "key_read%";
|
show status like "key_read%";
|
||||||
@ -123,8 +123,8 @@ test.t1 preload_keys status OK
|
|||||||
test.t2 preload_keys status OK
|
test.t2 preload_keys status OK
|
||||||
show status like "key_read%";
|
show status like "key_read%";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Key_read_requests 0
|
Key_read_requests 587
|
||||||
Key_reads 0
|
Key_reads 587
|
||||||
select count(*) from t1 where b = 'test1';
|
select count(*) from t1 where b = 'test1';
|
||||||
count(*)
|
count(*)
|
||||||
4181
|
4181
|
||||||
@ -133,8 +133,8 @@ count(*)
|
|||||||
2584
|
2584
|
||||||
show status like "key_read%";
|
show status like "key_read%";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Key_read_requests 351
|
Key_read_requests 938
|
||||||
Key_reads 73
|
Key_reads 613
|
||||||
flush tables;
|
flush tables;
|
||||||
flush status;
|
flush status;
|
||||||
show status like "key_read%";
|
show status like "key_read%";
|
||||||
@ -147,8 +147,8 @@ test.t3 preload_keys error Table 'test.t3' doesn't exist
|
|||||||
test.t2 preload_keys status OK
|
test.t2 preload_keys status OK
|
||||||
show status like "key_read%";
|
show status like "key_read%";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Key_read_requests 0
|
Key_read_requests 355
|
||||||
Key_reads 0
|
Key_reads 355
|
||||||
flush tables;
|
flush tables;
|
||||||
flush status;
|
flush status;
|
||||||
show status like "key_read%";
|
show status like "key_read%";
|
||||||
|
@ -2387,3 +2387,16 @@ EXPLAIN SELECT i FROM t1 WHERE i=1;
|
|||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
|
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 ( a BLOB, INDEX (a(20)) );
|
||||||
|
CREATE TABLE t2 ( a BLOB, INDEX (a(20)) );
|
||||||
|
INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five');
|
||||||
|
INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five');
|
||||||
|
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
|
||||||
|
1 SIMPLE t2 ref a a 23 test.t1.a 2
|
||||||
|
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
|
||||||
|
1 SIMPLE t2 ref a a 23 test.t1.a 2
|
||||||
|
DROP TABLE t1, t2;
|
||||||
|
@ -1173,3 +1173,25 @@ show columns from t4;
|
|||||||
Field Type Null Key Default Extra
|
Field Type Null Key Default Extra
|
||||||
sdate date YES NULL
|
sdate date YES NULL
|
||||||
drop table t1, t2, t3, t4;
|
drop table t1, t2, t3, t4;
|
||||||
|
create table t1 (a int not null, b char (10) not null);
|
||||||
|
insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
|
||||||
|
select * from ((select * from t1 limit 1)) a;
|
||||||
|
a b
|
||||||
|
1 a
|
||||||
|
select * from ((select * from t1 limit 1) union (select * from t1 limit 1)) a;
|
||||||
|
a b
|
||||||
|
1 a
|
||||||
|
select * from ((select * from t1 limit 1) union (select * from t1 limit 1) union (select * from t1 limit 1)) a;
|
||||||
|
a b
|
||||||
|
1 a
|
||||||
|
select * from ((((select * from t1))) union (select * from t1) union (select * from t1)) a;
|
||||||
|
a b
|
||||||
|
1 a
|
||||||
|
2 b
|
||||||
|
3 c
|
||||||
|
select * from ((select * from t1) union (((select * from t1))) union (select * from t1)) a;
|
||||||
|
a b
|
||||||
|
1 a
|
||||||
|
2 b
|
||||||
|
3 c
|
||||||
|
drop table t1;
|
||||||
|
@ -390,3 +390,24 @@ SET collation_connection='ucs2_general_ci';
|
|||||||
SET NAMES latin1;
|
SET NAMES latin1;
|
||||||
SET collation_connection='ucs2_bin';
|
SET collation_connection='ucs2_bin';
|
||||||
-- source include/ctype_filesort.inc
|
-- source include/ctype_filesort.inc
|
||||||
|
|
||||||
|
SET NAMES latin1;
|
||||||
|
#
|
||||||
|
# Bug#8235
|
||||||
|
#
|
||||||
|
# This bug also helped to find another problem that
|
||||||
|
# INSERT of a UCS2 string containing a negative number
|
||||||
|
# into a unsigned int column didn't produce warnings.
|
||||||
|
# This test covers both problems.
|
||||||
|
#
|
||||||
|
SET collation_connection='ucs2_swedish_ci';
|
||||||
|
CREATE TABLE t1 (Field1 int(10) default '0');
|
||||||
|
# no warnings, negative numbers are allowed
|
||||||
|
INSERT INTO t1 VALUES ('-1');
|
||||||
|
SELECT * FROM t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (Field1 int(10) unsigned default '0');
|
||||||
|
# this should generate a "Data truncated" warning
|
||||||
|
INSERT INTO t1 VALUES ('-1');
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET NAMES latin1;
|
||||||
|
@ -1930,3 +1930,18 @@ INSERT INTO t1 VALUES (3,'c');
|
|||||||
EXPLAIN SELECT i FROM t1 WHERE i=1;
|
EXPLAIN SELECT i FROM t1 WHERE i=1;
|
||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test case for bug 7520: a wrong cost of the index for a BLOB field
|
||||||
|
#
|
||||||
|
|
||||||
|
CREATE TABLE t1 ( a BLOB, INDEX (a(20)) );
|
||||||
|
CREATE TABLE t2 ( a BLOB, INDEX (a(20)) );
|
||||||
|
|
||||||
|
INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five');
|
||||||
|
INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five');
|
||||||
|
|
||||||
|
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
|
||||||
|
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
|
||||||
|
|
||||||
|
DROP TABLE t1, t2;
|
||||||
|
@ -699,3 +699,15 @@ union
|
|||||||
order by sdate;
|
order by sdate;
|
||||||
show columns from t4;
|
show columns from t4;
|
||||||
drop table t1, t2, t3, t4;
|
drop table t1, t2, t3, t4;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #2435 UNION with parentheses not supported
|
||||||
|
#
|
||||||
|
create table t1 (a int not null, b char (10) not null);
|
||||||
|
insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
|
||||||
|
select * from ((select * from t1 limit 1)) a;
|
||||||
|
select * from ((select * from t1 limit 1) union (select * from t1 limit 1)) a;
|
||||||
|
select * from ((select * from t1 limit 1) union (select * from t1 limit 1) union (select * from t1 limit 1)) a;
|
||||||
|
select * from ((((select * from t1))) union (select * from t1) union (select * from t1)) a;
|
||||||
|
select * from ((select * from t1) union (((select * from t1))) union (select * from t1)) a;
|
||||||
|
drop table t1;
|
||||||
|
@ -163,9 +163,7 @@ then
|
|||||||
INSERT INTO user (host,user) values ('localhost','');"
|
INSERT INTO user (host,user) values ('localhost','');"
|
||||||
else
|
else
|
||||||
i_u="$i_u
|
i_u="$i_u
|
||||||
INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
|
INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);"
|
||||||
INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
|
|
||||||
INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0);"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -114,6 +114,8 @@
|
|||||||
data - The data is stored in a "row +blobs" format.
|
data - The data is stored in a "row +blobs" format.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* If the archive storage engine has been inited */
|
||||||
|
static bool archive_inited= 0;
|
||||||
/* Variables for archive share methods */
|
/* Variables for archive share methods */
|
||||||
pthread_mutex_t archive_mutex;
|
pthread_mutex_t archive_mutex;
|
||||||
static HASH archive_open_tables;
|
static HASH archive_open_tables;
|
||||||
@ -157,6 +159,7 @@ static byte* archive_get_key(ARCHIVE_SHARE *share,uint *length,
|
|||||||
|
|
||||||
bool archive_db_init()
|
bool archive_db_init()
|
||||||
{
|
{
|
||||||
|
archive_inited= 1;
|
||||||
VOID(pthread_mutex_init(&archive_mutex, MY_MUTEX_INIT_FAST));
|
VOID(pthread_mutex_init(&archive_mutex, MY_MUTEX_INIT_FAST));
|
||||||
return (hash_init(&archive_open_tables, system_charset_info, 32, 0, 0,
|
return (hash_init(&archive_open_tables, system_charset_info, 32, 0, 0,
|
||||||
(hash_get_key) archive_get_key, 0, 0));
|
(hash_get_key) archive_get_key, 0, 0));
|
||||||
@ -176,8 +179,12 @@ bool archive_db_init()
|
|||||||
|
|
||||||
bool archive_db_end()
|
bool archive_db_end()
|
||||||
{
|
{
|
||||||
hash_free(&archive_open_tables);
|
if (archive_inited)
|
||||||
VOID(pthread_mutex_destroy(&archive_mutex));
|
{
|
||||||
|
hash_free(&archive_open_tables);
|
||||||
|
VOID(pthread_mutex_destroy(&archive_mutex));
|
||||||
|
}
|
||||||
|
archive_inited= 0;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
sql/field.cc
12
sql/field.cc
@ -1777,6 +1777,14 @@ void Field_medium::sql_type(String &res) const
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
static bool test_if_minus(CHARSET_INFO *cs,
|
||||||
|
const char *s, const char *e)
|
||||||
|
{
|
||||||
|
my_wc_t wc;
|
||||||
|
return cs->cset->mb_wc(cs, &wc, (uchar*) s, (uchar*) e) > 0 && wc == '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
|
int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
|
||||||
{
|
{
|
||||||
long tmp;
|
long tmp;
|
||||||
@ -1790,7 +1798,7 @@ int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
|
|||||||
|
|
||||||
if (unsigned_flag)
|
if (unsigned_flag)
|
||||||
{
|
{
|
||||||
if (!len || *from == '-')
|
if (!len || test_if_minus(cs, from, from + len))
|
||||||
{
|
{
|
||||||
tmp=0; // Set negative to 0
|
tmp=0; // Set negative to 0
|
||||||
my_errno=ERANGE;
|
my_errno=ERANGE;
|
||||||
@ -2086,7 +2094,7 @@ int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs)
|
|||||||
my_errno=0;
|
my_errno=0;
|
||||||
if (unsigned_flag)
|
if (unsigned_flag)
|
||||||
{
|
{
|
||||||
if (!len || *from == '-')
|
if (!len || test_if_minus(cs, from, from + len))
|
||||||
{
|
{
|
||||||
tmp=0; // Set negative to 0
|
tmp=0; // Set negative to 0
|
||||||
my_errno= ERANGE;
|
my_errno= ERANGE;
|
||||||
|
@ -2797,7 +2797,7 @@ bool Item_type_holder::join_types(THD *thd, Item *item, TABLE *table)
|
|||||||
bool use_new_field= 0, use_expression_type= 0;
|
bool use_new_field= 0, use_expression_type= 0;
|
||||||
Item_result new_result_type= type_convertor[item_type][item->result_type()];
|
Item_result new_result_type= type_convertor[item_type][item->result_type()];
|
||||||
Field *field= get_holder_example_field(thd, item, table);
|
Field *field= get_holder_example_field(thd, item, table);
|
||||||
bool item_is_a_field= field;
|
bool item_is_a_field= (field != NULL);
|
||||||
/*
|
/*
|
||||||
Check if both items point to fields: in this case we
|
Check if both items point to fields: in this case we
|
||||||
can adjust column types of result table in the union smartly.
|
can adjust column types of result table in the union smartly.
|
||||||
|
@ -1274,7 +1274,7 @@ bool MYSQL_LOG::write(Log_event* event_info)
|
|||||||
binlog_[wild_]{do|ignore}_table?" (WL#1049)"
|
binlog_[wild_]{do|ignore}_table?" (WL#1049)"
|
||||||
*/
|
*/
|
||||||
if ((thd && !(thd->options & OPTION_BIN_LOG)) ||
|
if ((thd && !(thd->options & OPTION_BIN_LOG)) ||
|
||||||
(local_db && !db_ok(local_db, binlog_do_db, binlog_ignore_db)))
|
(!db_ok(local_db, binlog_do_db, binlog_ignore_db)))
|
||||||
{
|
{
|
||||||
VOID(pthread_mutex_unlock(&LOCK_log));
|
VOID(pthread_mutex_unlock(&LOCK_log));
|
||||||
DBUG_PRINT("error",("!db_ok('%s')", local_db));
|
DBUG_PRINT("error",("!db_ok('%s')", local_db));
|
||||||
|
@ -1421,7 +1421,7 @@ ulong Query_cache::init_cache()
|
|||||||
init();
|
init();
|
||||||
approx_additional_data_size = (sizeof(Query_cache) +
|
approx_additional_data_size = (sizeof(Query_cache) +
|
||||||
sizeof(gptr)*(def_query_hash_size+
|
sizeof(gptr)*(def_query_hash_size+
|
||||||
def_query_hash_size));
|
def_table_hash_size));
|
||||||
if (query_cache_size < approx_additional_data_size)
|
if (query_cache_size < approx_additional_data_size)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
@ -2389,7 +2389,10 @@ select:
|
|||||||
select_init:
|
select_init:
|
||||||
SELECT_SYM select_init2
|
SELECT_SYM select_init2
|
||||||
|
|
|
|
||||||
'(' SELECT_SYM select_part2 ')'
|
'(' select_paren ')' union_opt;
|
||||||
|
|
||||||
|
select_paren:
|
||||||
|
SELECT_SYM select_part2
|
||||||
{
|
{
|
||||||
LEX *lex= Lex;
|
LEX *lex= Lex;
|
||||||
SELECT_LEX * sel= lex->current_select;
|
SELECT_LEX * sel= lex->current_select;
|
||||||
@ -2408,7 +2411,8 @@ select_init:
|
|||||||
if (sel->master_unit()->fake_select_lex)
|
if (sel->master_unit()->fake_select_lex)
|
||||||
sel->master_unit()->global_parameters=
|
sel->master_unit()->global_parameters=
|
||||||
sel->master_unit()->fake_select_lex;
|
sel->master_unit()->fake_select_lex;
|
||||||
} union_opt;
|
}
|
||||||
|
| '(' select_paren ')';
|
||||||
|
|
||||||
select_init2:
|
select_init2:
|
||||||
select_part2
|
select_part2
|
||||||
@ -3404,8 +3408,7 @@ when_list2:
|
|||||||
};
|
};
|
||||||
|
|
||||||
join_table_list:
|
join_table_list:
|
||||||
'(' join_table_list ')' { $$=$2; }
|
join_table { $$=$1; }
|
||||||
| join_table { $$=$1; }
|
|
||||||
| join_table_list ',' join_table_list { $$=$3; }
|
| join_table_list ',' join_table_list { $$=$3; }
|
||||||
| join_table_list normal_join join_table_list { $$=$3; }
|
| join_table_list normal_join join_table_list { $$=$3; }
|
||||||
| join_table_list STRAIGHT_JOIN join_table_list
|
| join_table_list STRAIGHT_JOIN join_table_list
|
||||||
@ -3482,7 +3485,7 @@ join_table:
|
|||||||
}
|
}
|
||||||
| '{' ident join_table LEFT OUTER JOIN_SYM join_table ON expr '}'
|
| '{' ident join_table LEFT OUTER JOIN_SYM join_table ON expr '}'
|
||||||
{ add_join_on($7,$9); $7->outer_join|=JOIN_TYPE_LEFT; $$=$7; }
|
{ add_join_on($7,$9); $7->outer_join|=JOIN_TYPE_LEFT; $$=$7; }
|
||||||
| '(' SELECT_SYM select_derived ')' opt_table_alias
|
| '(' select_derived union_opt ')' opt_table_alias
|
||||||
{
|
{
|
||||||
LEX *lex=Lex;
|
LEX *lex=Lex;
|
||||||
SELECT_LEX_UNIT *unit= lex->current_select->master_unit();
|
SELECT_LEX_UNIT *unit= lex->current_select->master_unit();
|
||||||
@ -3493,9 +3496,27 @@ join_table:
|
|||||||
(List<String> *)0)))
|
(List<String> *)0)))
|
||||||
|
|
||||||
YYABORT;
|
YYABORT;
|
||||||
};
|
}
|
||||||
|
| '(' join_table_list ')' { $$=$2; };
|
||||||
|
|
||||||
select_derived:
|
select_derived:
|
||||||
|
SELECT_SYM select_derived2
|
||||||
|
| '(' select_derived ')'
|
||||||
|
{
|
||||||
|
LEX *lex= Lex;
|
||||||
|
SELECT_LEX * sel= lex->current_select;
|
||||||
|
if (sel->set_braces(1))
|
||||||
|
{
|
||||||
|
yyerror(ER(ER_SYNTAX_ERROR));
|
||||||
|
YYABORT;
|
||||||
|
}
|
||||||
|
/* select in braces, can't contain global parameters */
|
||||||
|
if (sel->master_unit()->fake_select_lex)
|
||||||
|
sel->master_unit()->global_parameters=
|
||||||
|
sel->master_unit()->fake_select_lex;
|
||||||
|
};
|
||||||
|
|
||||||
|
select_derived2:
|
||||||
{
|
{
|
||||||
LEX *lex= Lex;
|
LEX *lex= Lex;
|
||||||
lex->derived_tables= 1;
|
lex->derived_tables= 1;
|
||||||
@ -3517,7 +3538,7 @@ select_derived:
|
|||||||
{
|
{
|
||||||
Select->parsing_place= NO_MATTER;
|
Select->parsing_place= NO_MATTER;
|
||||||
}
|
}
|
||||||
opt_select_from union_opt
|
opt_select_from
|
||||||
;
|
;
|
||||||
|
|
||||||
opt_outer:
|
opt_outer:
|
||||||
|
12
sql/table.cc
12
sql/table.cc
@ -195,7 +195,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
|
|||||||
goto err_not_open; /* purecov: inspected */
|
goto err_not_open; /* purecov: inspected */
|
||||||
bzero((char*) keyinfo,n_length);
|
bzero((char*) keyinfo,n_length);
|
||||||
outparam->key_info=keyinfo;
|
outparam->key_info=keyinfo;
|
||||||
outparam->max_key_length= outparam->total_key_length= 0;
|
|
||||||
key_part= my_reinterpret_cast(KEY_PART_INFO*) (keyinfo+keys);
|
key_part= my_reinterpret_cast(KEY_PART_INFO*) (keyinfo+keys);
|
||||||
strpos=disk_buff+6;
|
strpos=disk_buff+6;
|
||||||
|
|
||||||
@ -251,11 +250,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
|
|||||||
}
|
}
|
||||||
key_part->store_length=key_part->length;
|
key_part->store_length=key_part->length;
|
||||||
}
|
}
|
||||||
set_if_bigger(outparam->max_key_length,keyinfo->key_length+
|
|
||||||
keyinfo->key_parts);
|
|
||||||
outparam->total_key_length+= keyinfo->key_length;
|
|
||||||
if (keyinfo->flags & HA_NOSAME)
|
|
||||||
set_if_bigger(outparam->max_unique_length,keyinfo->key_length);
|
|
||||||
}
|
}
|
||||||
keynames=(char*) key_part;
|
keynames=(char*) key_part;
|
||||||
strpos+= (strmov(keynames, (char *) strpos) - keynames)+1;
|
strpos+= (strmov(keynames, (char *) strpos) - keynames)+1;
|
||||||
@ -685,6 +679,12 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
keyinfo->usable_key_parts=usable_parts; // Filesort
|
keyinfo->usable_key_parts=usable_parts; // Filesort
|
||||||
|
|
||||||
|
set_if_bigger(outparam->max_key_length,keyinfo->key_length+
|
||||||
|
keyinfo->key_parts);
|
||||||
|
outparam->total_key_length+= keyinfo->key_length;
|
||||||
|
if (keyinfo->flags & HA_NOSAME)
|
||||||
|
set_if_bigger(outparam->max_unique_length,keyinfo->key_length);
|
||||||
}
|
}
|
||||||
if (primary_key < MAX_KEY &&
|
if (primary_key < MAX_KEY &&
|
||||||
(outparam->keys_in_use.is_set(primary_key)))
|
(outparam->keys_in_use.is_set(primary_key)))
|
||||||
|
@ -1480,6 +1480,29 @@ my_bool my_like_range_ucs2(CHARSET_INFO *cs,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ulong my_scan_ucs2(CHARSET_INFO *cs __attribute__((unused)),
|
||||||
|
const char *str, const char *end, int sequence_type)
|
||||||
|
{
|
||||||
|
const char *str0= str;
|
||||||
|
end--; /* for easier loop condition, because of two bytes per character */
|
||||||
|
|
||||||
|
switch (sequence_type)
|
||||||
|
{
|
||||||
|
case MY_SEQ_SPACES:
|
||||||
|
for ( ; str < end; str+= 2)
|
||||||
|
{
|
||||||
|
if (str[0] != '\0' || str[1] != ' ')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return str - str0;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler =
|
static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler =
|
||||||
{
|
{
|
||||||
NULL, /* init */
|
NULL, /* init */
|
||||||
@ -1534,7 +1557,7 @@ MY_CHARSET_HANDLER my_charset_ucs2_handler=
|
|||||||
my_strntoull_ucs2,
|
my_strntoull_ucs2,
|
||||||
my_strntod_ucs2,
|
my_strntod_ucs2,
|
||||||
my_strtoll10_ucs2,
|
my_strtoll10_ucs2,
|
||||||
my_scan_8bit
|
my_scan_ucs2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <my_global.h>
|
#include <my_global.h>
|
||||||
#include <my_sys.h>
|
#include <my_sys.h>
|
||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
|
#include <errmsg.h>
|
||||||
#include <my_getopt.h>
|
#include <my_getopt.h>
|
||||||
#include <m_string.h>
|
#include <m_string.h>
|
||||||
|
|
||||||
@ -11532,6 +11533,78 @@ static void test_bug6761(void)
|
|||||||
myquery(rc);
|
myquery(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Bug#8330 - mysql_stmt_execute crashes (libmysql) */
|
||||||
|
|
||||||
|
static void test_bug8330()
|
||||||
|
{
|
||||||
|
const char *stmt_text;
|
||||||
|
MYSQL_STMT *stmt[2];
|
||||||
|
int i, rc;
|
||||||
|
char *query= "select a,b from t1 where a=?";
|
||||||
|
MYSQL_BIND bind[2];
|
||||||
|
long lval[2];
|
||||||
|
|
||||||
|
myheader("test_bug8330");
|
||||||
|
|
||||||
|
stmt_text= "drop table if exists t1";
|
||||||
|
/* in case some previos test failed */
|
||||||
|
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
||||||
|
myquery(rc);
|
||||||
|
stmt_text= "create table t1 (a int, b int)";
|
||||||
|
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
||||||
|
myquery(rc);
|
||||||
|
|
||||||
|
bzero(bind, sizeof(bind));
|
||||||
|
for (i=0; i < 2; i++)
|
||||||
|
{
|
||||||
|
stmt[i]= mysql_stmt_init(mysql);
|
||||||
|
rc= mysql_stmt_prepare(stmt[i], query, strlen(query));
|
||||||
|
check_execute(stmt[i], rc);
|
||||||
|
|
||||||
|
bind[i].buffer_type= MYSQL_TYPE_LONG;
|
||||||
|
bind[i].buffer= (void*) &lval[i];
|
||||||
|
bind[i].is_null= 0;
|
||||||
|
mysql_stmt_bind_param(stmt[i], &bind[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
rc= mysql_stmt_execute(stmt[0]);
|
||||||
|
check_execute(stmt[0], rc);
|
||||||
|
|
||||||
|
rc= mysql_stmt_execute(stmt[1]);
|
||||||
|
DIE_UNLESS(rc && mysql_stmt_errno(stmt[1]) == CR_COMMANDS_OUT_OF_SYNC);
|
||||||
|
rc= mysql_stmt_execute(stmt[0]);
|
||||||
|
check_execute(stmt[0], rc);
|
||||||
|
|
||||||
|
mysql_stmt_close(stmt[0]);
|
||||||
|
mysql_stmt_close(stmt[1]);
|
||||||
|
|
||||||
|
stmt_text= "drop table t1";
|
||||||
|
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
||||||
|
myquery(rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Bug#7990 - mysql_stmt_close doesn't reset mysql->net.last_error */
|
||||||
|
|
||||||
|
static void test_bug7990()
|
||||||
|
{
|
||||||
|
MYSQL_STMT *stmt;
|
||||||
|
int rc;
|
||||||
|
myheader("test_bug7990");
|
||||||
|
|
||||||
|
stmt= mysql_stmt_init(mysql);
|
||||||
|
rc= mysql_stmt_prepare(stmt, "foo", 3);
|
||||||
|
/*
|
||||||
|
XXX: the fact that we store errno both in STMT and in
|
||||||
|
MYSQL is not documented and is subject to change in 5.0
|
||||||
|
*/
|
||||||
|
DIE_UNLESS(rc && mysql_stmt_errno(stmt) && mysql_errno(mysql));
|
||||||
|
mysql_stmt_close(stmt);
|
||||||
|
DIE_UNLESS(!mysql_errno(mysql));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Read and parse arguments and MySQL options from my.cnf
|
Read and parse arguments and MySQL options from my.cnf
|
||||||
*/
|
*/
|
||||||
@ -11739,6 +11812,8 @@ static struct my_tests_st my_tests[]= {
|
|||||||
{ "test_conversion", test_conversion },
|
{ "test_conversion", test_conversion },
|
||||||
{ "test_rewind", test_rewind },
|
{ "test_rewind", test_rewind },
|
||||||
{ "test_bug6761", test_bug6761 },
|
{ "test_bug6761", test_bug6761 },
|
||||||
|
{ "test_bug8330", test_bug8330 },
|
||||||
|
{ "test_bug7990", test_bug7990 },
|
||||||
{ 0, 0 }
|
{ 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user