Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4b4c887a
Commit
4b4c887a
authored
Feb 14, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into poseidon.ndb.mysql.com:/home/tomas/mysql-4.1
parents
211e8b03
e2b64801
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
343 additions
and
80 deletions
+343
-80
BitKeeper/triggers/post-commit
BitKeeper/triggers/post-commit
+13
-7
Build-tools/Do-compile
Build-tools/Do-compile
+4
-2
VC++Files/tests/mysql_client_test.dsp
VC++Files/tests/mysql_client_test.dsp
+6
-6
extra/replace.c
extra/replace.c
+13
-13
include/my_pthread.h
include/my_pthread.h
+1
-1
innobase/row/row0mysql.c
innobase/row/row0mysql.c
+1
-1
libmysql/libmysql.c
libmysql/libmysql.c
+22
-0
libmysqld/emb_qcache.cc
libmysqld/emb_qcache.cc
+11
-7
myisam/mi_preload.c
myisam/mi_preload.c
+4
-4
mysql-test/r/ctype_ucs.result
mysql-test/r/ctype_ucs.result
+14
-0
mysql-test/r/distinct.result
mysql-test/r/distinct.result
+1
-1
mysql-test/r/preload.result
mysql-test/r/preload.result
+14
-14
mysql-test/r/select.result
mysql-test/r/select.result
+13
-0
mysql-test/r/union.result
mysql-test/r/union.result
+22
-0
mysql-test/t/ctype_ucs.test
mysql-test/t/ctype_ucs.test
+21
-0
mysql-test/t/select.test
mysql-test/t/select.test
+15
-0
mysql-test/t/union.test
mysql-test/t/union.test
+12
-0
scripts/mysql_create_system_tables.sh
scripts/mysql_create_system_tables.sh
+1
-3
sql/examples/ha_archive.cc
sql/examples/ha_archive.cc
+9
-2
sql/field.cc
sql/field.cc
+10
-2
sql/item.cc
sql/item.cc
+1
-1
sql/log.cc
sql/log.cc
+1
-1
sql/sql_cache.cc
sql/sql_cache.cc
+1
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+28
-7
sql/table.cc
sql/table.cc
+6
-6
strings/ctype-ucs2.c
strings/ctype-ucs2.c
+24
-1
tests/mysql_client_test.c
tests/mysql_client_test.c
+75
-0
No files found.
BitKeeper/triggers/post-commit
View file @
4b4c887a
...
...
@@ -20,14 +20,20 @@ if [ "$BK_STATUS" = OK ]
then
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'
`
if
[
"
$BUG
"
=
""
]
then
TO
=
dev-public@mysql.com
BS
=
""
BH
=
""
else
TO
=
dev-bugs@mysql.com
BS
=
" BUG#
$BUG
"
# need newline here
BH
=
"X-Bug:
$BUG
"
fi
#++
# dev-public@ / dev-bugs@
...
...
@@ -38,8 +44,8 @@ fi
List-ID: <bk.mysql-
$VERSION
>
From:
$FROM
To:
$TO
Subject: bk commit -
$VERSION
tree (
$CHANGESET
)
${
B
UG
}${
WL
}
Subject: bk commit -
$VERSION
tree (
$CHANGESET
)
${
B
S
}${
WL
}
$BH
EOF
bk changes
-v
-r
+
bk cset
-r
+
-d
...
...
@@ -54,14 +60,14 @@ EOF
List-ID: <bk.mysql-
$VERSION
>
From:
$FROM
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
$VERSION
repository of
$USER
. When
$USER
does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to 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
bk changes
-v
-r
+
...
...
@@ -81,7 +87,7 @@ EOF
List-ID: <bk.mysql-
$VERSION
>
From:
$FROM
To:
$DOCS
Subject: bk commit -
$VERSION
tree (Manual) (
$CHANGESET
)
Subject: bk commit -
$VERSION
tree (Manual) (
$CHANGESET
)
$BS
EOF
bk changes
-v
-r
+
...
...
Build-tools/Do-compile
View file @
4b4c887a
...
...
@@ -806,7 +806,7 @@ sub find
sub
rm_all
{
my
(
@rm_files
)
=
@_
;
my
(
$dir
,
$current_dir
,
@files
,
@dirs
);
my
(
$dir
,
$current_dir
,
@files
,
@dirs
,
$removed
);
$current_dir
=
`
pwd
`;
chomp
(
$current_dir
);
foreach
$dir
(
@rm_files
)
...
...
@@ -830,7 +830,9 @@ sub rm_all
}
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
)
{
...
...
VC++Files/tests/mysql_client_test.dsp
View file @
4b4c887a
...
...
@@ -66,18 +66,18 @@ LINK32=link.exe
# PROP Output_Dir ".\Release"
# PROP Intermediate_Dir ".\Release"
# 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 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 MTL /nologo /tlb".\Release\
client_test.tlb" /win32
# ADD MTL /nologo /tlb".\Release\
client_test.tlb" /win32
# 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/
mysql_client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX
# ADD BASE MTL /nologo /tlb".\Release\
mysql_client_test.tlb" /win32
# ADD MTL /nologo /tlb".\Release\
mysql_client_test.tlb" /win32
# ADD BASE RSC /l 1033
# ADD RSC /l 1033
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
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 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\
mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console
!ENDIF
...
...
extra/replace.c
View file @
4b4c887a
...
...
@@ -376,8 +376,8 @@ static REP_SET *make_new_set(REP_SETS *sets);
static
void
make_sets_invisible
(
REP_SETS
*
sets
);
static
void
free_last_set
(
REP_SETS
*
sets
);
static
void
free_sets
(
REP_SETS
*
sets
);
static
void
set_bit
(
REP_SET
*
set
,
uint
bit
);
static
void
clear_bit
(
REP_SET
*
set
,
uint
bit
);
static
void
internal_
set_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
copy_bits
(
REP_SET
*
to
,
REP_SET
*
from
);
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
]
==
'^'
)
{
set_bit
(
start_states
,
states
+
1
);
internal_
set_bit
(
start_states
,
states
+
1
);
if
(
!
from
[
i
][
2
])
{
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
]
==
'$'
)
{
set_bit
(
start_states
,
states
);
set_bit
(
word_states
,
states
);
internal_
set_bit
(
start_states
,
states
);
internal_
set_bit
(
word_states
,
states
);
if
(
!
from
[
i
][
2
]
&&
start_states
->
table_offset
==
(
uint
)
~
0
)
{
start_states
->
table_offset
=
i
;
...
...
@@ -473,11 +473,11 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count,
}
else
{
set_bit
(
word_states
,
states
);
internal_
set_bit
(
word_states
,
states
);
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
set_bit
(
start_states
,
states
);
internal_
set_bit
(
start_states
,
states
);
}
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
)
found_end
=
follow
[
i
].
len
;
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
set_bit
(
new_set
,
i
);
internal_
set_bit
(
new_set
,
i
);
}
}
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
||
(
new_set
->
found_len
&&
(
chr
==
0
||
!
follow
[
bit_nr
].
chr
)))
clear_bit
(
new_set
,
i
);
internal_
clear_bit
(
new_set
,
i
);
else
{
if
(
chr
==
0
||
!
follow
[
bit_nr
].
chr
)
...
...
@@ -751,13 +751,13 @@ static void free_sets(REP_SETS *sets)
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
);
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
));
return
;
...
...
include/my_pthread.h
View file @
4b4c887a
...
...
@@ -637,7 +637,7 @@ extern int pthread_dummy(int);
MySQL can survive with 32K, but some glibc libraries require > 128K stack
To resolve hostnames
*/
#define DEFAULT_THREAD_STACK (
192
*1024L)
#define DEFAULT_THREAD_STACK (
256
*1024L)
#else
#define DEFAULT_THREAD_STACK (192*1024)
#endif
...
...
innobase/row/row0mysql.c
View file @
4b4c887a
...
...
@@ -417,7 +417,7 @@ row_create_prebuilt(
prebuilt
->
sel_graph
=
NULL
;
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
);
...
...
libmysql/libmysql.c
View file @
4b4c887a
...
...
@@ -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
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
);
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 */
/* Reserve place for null-marker bytes */
...
...
@@ -4501,6 +4518,11 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
if
(
mysql
)
{
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
)
{
char
buff
[
MYSQL_STMT_HEADER
];
/* 4 bytes - stmt id */
...
...
libmysqld/emb_qcache.cc
View file @
4b4c887a
...
...
@@ -71,9 +71,11 @@ void Querycache_stream::store_int(uint i)
cur_data
+=
4
;
return
;
}
memcpy
(
cur_data
,
&
i
,
rest_len
);
char
buf
[
4
];
int4store
(
buf
,
i
);
memcpy
(
cur_data
,
buf
,
rest_len
);
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
;
}
...
...
@@ -186,10 +188,12 @@ uint Querycache_stream::load_int()
cur_data
+=
4
;
return
result
;
}
memcpy
(
&
result
,
cur_data
,
rest_len
);
char
buf
[
4
];
memcpy
(
buf
,
cur_data
,
rest_len
);
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
;
result
=
uint4korr
(
buf
);
return
result
;
}
...
...
@@ -270,10 +274,10 @@ int Querycache_stream::load_column(MEM_ROOT *alloc, char** column)
return
0
;
}
len
--
;
if
(
!
(
*
column
=
(
char
*
)
alloc_root
(
alloc
,
len
+
4
+
1
)))
if
(
!
(
*
column
=
(
char
*
)
alloc_root
(
alloc
,
len
+
sizeof
(
uint
)
+
1
)))
return
1
;
int4store
(
*
column
,
len
)
;
(
*
column
)
+=
4
;
*
((
uint
*
)
*
column
)
=
len
;
(
*
column
)
+=
sizeof
(
uint
)
;
load_str_only
(
*
column
,
len
);
return
1
;
}
...
...
myisam/mi_preload.c
View file @
4b4c887a
...
...
@@ -71,15 +71,15 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
if
(
flush_key_blocks
(
share
->
key_cache
,
share
->
kfile
,
FLUSH_RELEASE
))
goto
err
;
do
{
/* Read the next block of index file into the preload buffer */
if
((
my_off_t
)
length
>
(
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
;
if
(
ignore_leaves
)
{
uchar
*
end
=
buff
+
length
;
...
...
@@ -88,7 +88,7 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
if
(
mi_test_if_nod
(
buff
))
{
if
(
key_cache_insert
(
share
->
key_cache
,
share
->
kfile
,
pos
,
DFLT_INIT_HITS
,
share
->
kfile
,
pos
,
DFLT_INIT_HITS
,
(
byte
*
)
buff
,
block_length
))
goto
err
;
}
...
...
mysql-test/r/ctype_ucs.result
View file @
4b4c887a
...
...
@@ -613,3 +613,17 @@ ucs2_bin 00610009
ucs2_bin 0061
ucs2_bin 00610020
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;
mysql-test/r/distinct.result
View file @
4b4c887a
...
...
@@ -190,7 +190,7 @@ insert into t3 select * from t4;
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
1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary
1 SIMPLE t3 ref a a 5 test.t1.a 1
0
Using where; Using index; Distinct
1 SIMPLE t3 ref a a 5 test.t1.a 1
1
Using where; Using index; Distinct
select distinct t1.a from t1,t3 where t1.a=t3.a;
a
1
...
...
mysql-test/r/preload.result
View file @
4b4c887a
...
...
@@ -74,15 +74,15 @@ Table Op Msg_type Msg_text
test.t1 preload_keys status OK
show status like "key_read%";
Variable_name Value
Key_read_requests
0
Key_reads
0
Key_read_requests
581
Key_reads
581
select count(*) from t1 where b = 'test1';
count(*)
4181
show status like "key_read%";
Variable_name Value
Key_read_requests
217
Key_reads
45
Key_read_requests
798
Key_reads
581
flush tables;
flush status;
show status like "key_read%";
...
...
@@ -98,15 +98,15 @@ Table Op Msg_type Msg_text
test.t1 preload_keys status OK
show status like "key_read%";
Variable_name Value
Key_read_requests 0
Key_reads 0
Key_read_requests
1
0
Key_reads
1
0
select count(*) from t1 where b = 'test1';
count(*)
4181
show status like "key_read%";
Variable_name Value
Key_read_requests 2
1
7
Key_reads
45
Key_read_requests 2
2
7
Key_reads
52
flush tables;
flush status;
show status like "key_read%";
...
...
@@ -123,8 +123,8 @@ test.t1 preload_keys status OK
test.t2 preload_keys status OK
show status like "key_read%";
Variable_name Value
Key_read_requests
0
Key_reads
0
Key_read_requests
587
Key_reads
587
select count(*) from t1 where b = 'test1';
count(*)
4181
...
...
@@ -133,8 +133,8 @@ count(*)
2584
show status like "key_read%";
Variable_name Value
Key_read_requests
351
Key_reads
7
3
Key_read_requests
938
Key_reads
61
3
flush tables;
flush status;
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
show status like "key_read%";
Variable_name Value
Key_read_requests
0
Key_reads
0
Key_read_requests
355
Key_reads
355
flush tables;
flush status;
show status like "key_read%";
...
...
mysql-test/r/select.result
View file @
4b4c887a
...
...
@@ -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
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
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;
mysql-test/r/union.result
View file @
4b4c887a
...
...
@@ -1173,3 +1173,25 @@ show columns from t4;
Field Type Null Key Default Extra
sdate date YES NULL
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;
mysql-test/t/ctype_ucs.test
View file @
4b4c887a
...
...
@@ -390,3 +390,24 @@ SET collation_connection='ucs2_general_ci';
SET
NAMES
latin1
;
SET
collation_connection
=
'ucs2_bin'
;
--
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
;
mysql-test/t/select.test
View file @
4b4c887a
...
...
@@ -1930,3 +1930,18 @@ INSERT INTO t1 VALUES (3,'c');
EXPLAIN
SELECT
i
FROM
t1
WHERE
i
=
1
;
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
;
mysql-test/t/union.test
View file @
4b4c887a
...
...
@@ -699,3 +699,15 @@ union
order
by
sdate
;
show
columns
from
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
;
scripts/mysql_create_system_tables.sh
View file @
4b4c887a
...
...
@@ -163,9 +163,7 @@ then
INSERT INTO user (host,user) values ('localhost','');"
else
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 ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',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);"
fi
fi
fi
...
...
sql/examples/ha_archive.cc
View file @
4b4c887a
...
...
@@ -114,6 +114,8 @@
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 */
pthread_mutex_t
archive_mutex
;
static
HASH
archive_open_tables
;
...
...
@@ -157,6 +159,7 @@ static byte* archive_get_key(ARCHIVE_SHARE *share,uint *length,
bool
archive_db_init
()
{
archive_inited
=
1
;
VOID
(
pthread_mutex_init
(
&
archive_mutex
,
MY_MUTEX_INIT_FAST
));
return
(
hash_init
(
&
archive_open_tables
,
system_charset_info
,
32
,
0
,
0
,
(
hash_get_key
)
archive_get_key
,
0
,
0
));
...
...
@@ -176,8 +179,12 @@ bool archive_db_init()
bool
archive_db_end
()
{
hash_free
(
&
archive_open_tables
);
VOID
(
pthread_mutex_destroy
(
&
archive_mutex
));
if
(
archive_inited
)
{
hash_free
(
&
archive_open_tables
);
VOID
(
pthread_mutex_destroy
(
&
archive_mutex
));
}
archive_inited
=
0
;
return
FALSE
;
}
...
...
sql/field.cc
View file @
4b4c887a
...
...
@@ -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
)
{
long
tmp
;
...
...
@@ -1790,7 +1798,7 @@ int Field_long::store(const char *from,uint len,CHARSET_INFO *cs)
if
(
unsigned_flag
)
{
if
(
!
len
||
*
from
==
'-'
)
if
(
!
len
||
test_if_minus
(
cs
,
from
,
from
+
len
)
)
{
tmp
=
0
;
// Set negative to 0
my_errno
=
ERANGE
;
...
...
@@ -2086,7 +2094,7 @@ int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs)
my_errno
=
0
;
if
(
unsigned_flag
)
{
if
(
!
len
||
*
from
==
'-'
)
if
(
!
len
||
test_if_minus
(
cs
,
from
,
from
+
len
)
)
{
tmp
=
0
;
// Set negative to 0
my_errno
=
ERANGE
;
...
...
sql/item.cc
View file @
4b4c887a
...
...
@@ -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
;
Item_result
new_result_type
=
type_convertor
[
item_type
][
item
->
result_type
()];
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
can adjust column types of result table in the union smartly.
...
...
sql/log.cc
View file @
4b4c887a
...
...
@@ -1274,7 +1274,7 @@ bool MYSQL_LOG::write(Log_event* event_info)
binlog_[wild_]{do|ignore}_table?" (WL#1049)"
*/
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
));
DBUG_PRINT
(
"error"
,(
"!db_ok('%s')"
,
local_db
));
...
...
sql/sql_cache.cc
View file @
4b4c887a
...
...
@@ -1421,7 +1421,7 @@ ulong Query_cache::init_cache()
init
();
approx_additional_data_size
=
(
sizeof
(
Query_cache
)
+
sizeof
(
gptr
)
*
(
def_query_hash_size
+
def_
query
_hash_size
));
def_
table
_hash_size
));
if
(
query_cache_size
<
approx_additional_data_size
)
goto
err
;
...
...
sql/sql_yacc.yy
View file @
4b4c887a
...
...
@@ -2389,7 +2389,10 @@ select:
select_init:
SELECT_SYM select_init2
|
'(' SELECT_SYM select_part2 ')'
'(' select_paren ')' union_opt;
select_paren:
SELECT_SYM select_part2
{
LEX *lex= Lex;
SELECT_LEX * sel= lex->current_select;
...
...
@@ -2408,7 +2411,8 @@ select_init:
if (sel->master_unit()->fake_select_lex)
sel->master_unit()->global_parameters=
sel->master_unit()->fake_select_lex;
} union_opt;
}
| '(' select_paren ')';
select_init2:
select_part2
...
...
@@ -3404,8 +3408,7 @@ when_list2:
};
join_table_list:
'(' join_table_list ')' { $$=$2; }
| join_table { $$=$1; }
join_table { $$=$1; }
| join_table_list ',' join_table_list { $$=$3; }
| join_table_list normal_join join_table_list { $$=$3; }
| 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 '}'
{ 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;
SELECT_LEX_UNIT *unit= lex->current_select->master_unit();
...
...
@@ -3493,9 +3496,27 @@ join_table:
(List<String> *)0)))
YYABORT;
};
}
| '(' join_table_list ')' { $$=$2; };
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->derived_tables= 1;
...
...
@@ -3517,7 +3538,7 @@ select_derived:
{
Select->parsing_place= NO_MATTER;
}
opt_select_from
union_opt
opt_select_from
;
opt_outer:
...
...
sql/table.cc
View file @
4b4c887a
...
...
@@ -195,7 +195,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
goto
err_not_open
;
/* purecov: inspected */
bzero
((
char
*
)
keyinfo
,
n_length
);
outparam
->
key_info
=
keyinfo
;
outparam
->
max_key_length
=
outparam
->
total_key_length
=
0
;
key_part
=
my_reinterpret_cast
(
KEY_PART_INFO
*
)
(
keyinfo
+
keys
);
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
;
}
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
;
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
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
&&
(
outparam
->
keys_in_use
.
is_set
(
primary_key
)))
...
...
strings/ctype-ucs2.c
View file @
4b4c887a
...
...
@@ -1480,6 +1480,29 @@ my_bool my_like_range_ucs2(CHARSET_INFO *cs,
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
=
{
NULL
,
/* init */
...
...
@@ -1534,7 +1557,7 @@ MY_CHARSET_HANDLER my_charset_ucs2_handler=
my_strntoull_ucs2
,
my_strntod_ucs2
,
my_strtoll10_ucs2
,
my_scan_
8bit
my_scan_
ucs2
};
...
...
tests/mysql_client_test.c
View file @
4b4c887a
...
...
@@ -24,6 +24,7 @@
#include <my_global.h>
#include <my_sys.h>
#include <mysql.h>
#include <errmsg.h>
#include <my_getopt.h>
#include <m_string.h>
...
...
@@ -11532,6 +11533,78 @@ static void test_bug6761(void)
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
*/
...
...
@@ -11739,6 +11812,8 @@ static struct my_tests_st my_tests[]= {
{
"test_conversion"
,
test_conversion
},
{
"test_rewind"
,
test_rewind
},
{
"test_bug6761"
,
test_bug6761
},
{
"test_bug8330"
,
test_bug8330
},
{
"test_bug7990"
,
test_bug7990
},
{
0
,
0
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment