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
df2b9343
Commit
df2b9343
authored
Dec 08, 2006
by
istruewing@chilla.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into chilla.local:/home/mydev/mysql-5.0-axmrg
parents
94eb027f
098abfad
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
477 additions
and
60 deletions
+477
-60
myisam/mi_check.c
myisam/mi_check.c
+73
-17
myisam/mi_dynrec.c
myisam/mi_dynrec.c
+5
-3
myisam/mi_packrec.c
myisam/mi_packrec.c
+328
-37
mysql-test/r/federated.result
mysql-test/r/federated.result
+28
-0
mysql-test/t/federated.test
mysql-test/t/federated.test
+32
-0
sql/ha_federated.cc
sql/ha_federated.cc
+11
-0
sql/sql_insert.cc
sql/sql_insert.cc
+0
-3
No files found.
myisam/mi_check.c
View file @
df2b9343
...
...
@@ -251,11 +251,12 @@ static int check_k_link(MI_CHECK *param, register MI_INFO *info, uint nr)
my_off_t
next_link
;
uint
block_size
=
(
nr
+
1
)
*
MI_MIN_KEY_BLOCK_LENGTH
;
ha_rows
records
;
char
llbuff
[
21
],
*
buff
;
char
llbuff
[
21
],
llbuff2
[
21
],
*
buff
;
DBUG_ENTER
(
"check_k_link"
);
DBUG_PRINT
(
"enter"
,
(
"block_size: %u"
,
block_size
));
if
(
param
->
testflag
&
T_VERBOSE
)
printf
(
"block_size %4
d:"
,
block_size
);
printf
(
"block_size %4
u:"
,
block_size
);
/* purecov: tested */
next_link
=
info
->
s
->
state
.
key_del
[
nr
];
records
=
(
ha_rows
)
(
info
->
state
->
key_file_length
/
block_size
);
...
...
@@ -265,14 +266,46 @@ static int check_k_link(MI_CHECK *param, register MI_INFO *info, uint nr)
DBUG_RETURN
(
1
);
if
(
param
->
testflag
&
T_VERBOSE
)
printf
(
"%16s"
,
llstr
(
next_link
,
llbuff
));
if
(
next_link
>
info
->
state
->
key_file_length
||
next_link
&
(
info
->
s
->
blocksize
-
1
))
/* Key blocks must lay within the key file length entirely. */
if
(
next_link
+
block_size
>
info
->
state
->
key_file_length
)
{
/* purecov: begin tested */
mi_check_print_error
(
param
,
"Invalid key block position: %s "
"key block size: %u file_length: %s"
,
llstr
(
next_link
,
llbuff
),
block_size
,
llstr
(
info
->
state
->
key_file_length
,
llbuff2
));
DBUG_RETURN
(
1
);
/* purecov: end */
}
/* Key blocks must be aligned at MI_MIN_KEY_BLOCK_LENGTH. */
if
(
next_link
&
(
MI_MIN_KEY_BLOCK_LENGTH
-
1
))
{
/* purecov: begin tested */
mi_check_print_error
(
param
,
"Mis-aligned key block: %s "
"minimum key block length: %u"
,
llstr
(
next_link
,
llbuff
),
MI_MIN_KEY_BLOCK_LENGTH
);
DBUG_RETURN
(
1
);
/* purecov: end */
}
/*
Read the key block with MI_MIN_KEY_BLOCK_LENGTH to find next link.
If the key cache block size is smaller than block_size, we can so
avoid unecessary eviction of cache block.
*/
if
(
!
(
buff
=
key_cache_read
(
info
->
s
->
key_cache
,
info
->
s
->
kfile
,
next_link
,
DFLT_INIT_HITS
,
(
byte
*
)
info
->
buff
,
myisam_block_size
,
block_size
,
1
)))
(
byte
*
)
info
->
buff
,
MI_MIN_KEY_BLOCK_LENGTH
,
MI_MIN_KEY_BLOCK_LENGTH
,
1
)))
{
/* purecov: begin tested */
mi_check_print_error
(
param
,
"key cache read error for block: %s"
,
llstr
(
next_link
,
llbuff
));
DBUG_RETURN
(
1
);
/* purecov: end */
}
next_link
=
mi_sizekorr
(
buff
);
records
--
;
param
->
key_file_blocks
+=
block_size
;
...
...
@@ -556,17 +589,37 @@ static int chk_index_down(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
ha_checksum
*
key_checksum
,
uint
level
)
{
char
llbuff
[
22
],
llbuff2
[
22
];
if
(
page
>
info
->
state
->
key_file_length
||
(
page
&
(
info
->
s
->
blocksize
-
1
)))
{
my_off_t
max_length
=
my_seek
(
info
->
s
->
kfile
,
0L
,
MY_SEEK_END
,
MYF
(
0
));
mi_check_print_error
(
param
,
"Wrong pagepointer: %s at page: %s"
,
llstr
(
page
,
llbuff
),
llstr
(
page
,
llbuff2
));
if
(
page
+
info
->
s
->
blocksize
>
max_length
)
DBUG_ENTER
(
"chk_index_down"
);
/* Key blocks must lay within the key file length entirely. */
if
(
page
+
keyinfo
->
block_length
>
info
->
state
->
key_file_length
)
{
/* purecov: begin tested */
/* Give it a chance to fit in the real file size. */
my_off_t
max_length
=
my_seek
(
info
->
s
->
kfile
,
0L
,
MY_SEEK_END
,
MYF
(
0
));
mi_check_print_error
(
param
,
"Invalid key block position: %s "
"key block size: %u file_length: %s"
,
llstr
(
page
,
llbuff
),
keyinfo
->
block_length
,
llstr
(
info
->
state
->
key_file_length
,
llbuff2
));
if
(
page
+
keyinfo
->
block_length
>
max_length
)
goto
err
;
info
->
state
->
key_file_length
=
(
max_length
&
~
(
my_off_t
)
(
info
->
s
->
blocksize
-
1
));
/* Fix the remebered key file length. */
info
->
state
->
key_file_length
=
(
max_length
&
~
(
my_off_t
)
(
keyinfo
->
block_length
-
1
));
/* purecov: end */
}
/* Key blocks must be aligned at MI_MIN_KEY_BLOCK_LENGTH. */
if
(
page
&
(
MI_MIN_KEY_BLOCK_LENGTH
-
1
))
{
/* purecov: begin tested */
mi_check_print_error
(
param
,
"Mis-aligned key block: %s "
"minimum key block length: %u"
,
llstr
(
page
,
llbuff
),
MI_MIN_KEY_BLOCK_LENGTH
);
goto
err
;
/* purecov: end */
}
if
(
!
_mi_fetch_keypage
(
info
,
keyinfo
,
page
,
DFLT_INIT_HITS
,
buff
,
0
))
{
mi_check_print_error
(
param
,
"Can't read key from filepos: %s"
,
...
...
@@ -577,9 +630,12 @@ static int chk_index_down(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
if
(
chk_index
(
param
,
info
,
keyinfo
,
page
,
buff
,
keys
,
key_checksum
,
level
))
goto
err
;
return
0
;
DBUG_RETURN
(
0
);
/* purecov: begin tested */
err:
return
1
;
DBUG_RETURN
(
1
);
/* purecov: end */
}
...
...
myisam/mi_dynrec.c
View file @
df2b9343
...
...
@@ -1029,9 +1029,11 @@ ulong _mi_rec_unpack(register MI_INFO *info, register byte *to, byte *from,
{
uint
size_length
=
rec_length
-
mi_portable_sizeof_char_ptr
;
ulong
blob_length
=
_mi_calc_blob_length
(
size_length
,
from
);
if
((
ulong
)
(
from_end
-
from
)
-
size_length
<
blob_length
||
min_pack_length
>
(
uint
)
(
from_end
-
(
from
+
size_length
+
blob_length
)))
goto
err
;
ulong
from_left
=
(
ulong
)
(
from_end
-
from
);
if
(
from_left
<
size_length
||
from_left
-
size_length
<
blob_length
||
from_left
-
size_length
-
blob_length
<
min_pack_length
)
goto
err
;
memcpy
((
byte
*
)
to
,(
byte
*
)
from
,(
size_t
)
size_length
);
from
+=
size_length
;
memcpy_fixed
((
byte
*
)
to
+
size_length
,(
byte
*
)
&
from
,
sizeof
(
char
*
));
...
...
myisam/mi_packrec.c
View file @
df2b9343
This diff is collapsed.
Click to expand it.
mysql-test/r/federated.result
View file @
df2b9343
...
...
@@ -1815,6 +1815,34 @@ engine = federated
connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/test';
drop table federated.test1, federated.test2;
drop table federated.test;
set names utf8;
create table federated.t1 (a varchar(64)) DEFAULT CHARSET=utf8;
insert into federated.t1 values (0x6DC3A56E6164);
select hex(a) from federated.t1;
hex(a)
6DC3A56E6164
create table federated.t1 (a varchar(64))
ENGINE=FEDERATED
connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'
DEFAULT CHARSET=utf8;
set names utf8;
select hex(a) from federated.t1;
hex(a)
6DC3A56E6164
insert into federated.t1 values (0xC3A4C3B6C3BCC39F);
insert into federated.t1 values (0xD18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E);
select hex(a) from federated.t1;
hex(a)
6DC3A56E6164
C3A4C3B6C3BCC39F
D18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E
select hex(a) from federated.t1;
hex(a)
6DC3A56E6164
C3A4C3B6C3BCC39F
D18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E
drop table federated.t1;
drop table federated.t1;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
...
...
mysql-test/t/federated.test
View file @
df2b9343
...
...
@@ -1544,4 +1544,36 @@ drop table federated.test1, federated.test2;
connection
slave
;
drop
table
federated
.
test
;
#
# BUG# 17044 Federated Storage Engine not UTF8 clean
#
connection
slave
;
set
names
utf8
;
create
table
federated
.
t1
(
a
varchar
(
64
))
DEFAULT
CHARSET
=
utf8
;
insert
into
federated
.
t1
values
(
0x6DC3A56E6164
);
select
hex
(
a
)
from
federated
.
t1
;
connection
master
;
--
replace_result
$SLAVE_MYPORT
SLAVE_PORT
eval
create
table
federated
.
t1
(
a
varchar
(
64
))
ENGINE
=
FEDERATED
connection
=
'mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'
DEFAULT
CHARSET
=
utf8
;
set
names
utf8
;
select
hex
(
a
)
from
federated
.
t1
;
insert
into
federated
.
t1
values
(
0xC3A4C3B6C3BCC39F
);
insert
into
federated
.
t1
values
(
0xD18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E
);
select
hex
(
a
)
from
federated
.
t1
;
connection
slave
;
select
hex
(
a
)
from
federated
.
t1
;
connection
master
;
drop
table
federated
.
t1
;
connection
slave
;
drop
table
federated
.
t1
;
source
include
/
federated_cleanup
.
inc
;
sql/ha_federated.cc
View file @
df2b9343
...
...
@@ -1434,6 +1434,16 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked)
/* Connect to foreign database mysql_real_connect() */
mysql
=
mysql_init
(
0
);
/*
BUG# 17044 Federated Storage Engine is not UTF8 clean
Add set names to whatever charset the table is at open
of table
*/
/* this sets the csname like 'set names utf8' */
mysql_options
(
mysql
,
MYSQL_SET_CHARSET_NAME
,
this
->
table
->
s
->
table_charset
->
csname
);
if
(
!
mysql
||
!
mysql_real_connect
(
mysql
,
share
->
hostname
,
share
->
username
,
...
...
@@ -1450,6 +1460,7 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked)
API silently reconnect. For future versions, we will need more logic to
deal with transactions
*/
mysql
->
reconnect
=
1
;
ref_length
=
(
table
->
s
->
primary_key
!=
MAX_KEY
?
...
...
sql/sql_insert.cc
View file @
df2b9343
...
...
@@ -1745,8 +1745,6 @@ void kill_delayed_threads(void)
delayed_insert
*
tmp
;
while
((
tmp
=
it
++
))
{
/* Ensure that the thread doesn't kill itself while we are looking at it */
pthread_mutex_lock
(
&
tmp
->
mutex
);
tmp
->
thd
.
killed
=
THD
::
KILL_CONNECTION
;
if
(
tmp
->
thd
.
mysys_var
)
{
...
...
@@ -1765,7 +1763,6 @@ void kill_delayed_threads(void)
}
pthread_mutex_unlock
(
&
tmp
->
thd
.
mysys_var
->
mutex
);
}
pthread_mutex_unlock
(
&
tmp
->
mutex
);
}
VOID
(
pthread_mutex_unlock
(
&
LOCK_delayed_insert
));
// For unlink from list
}
...
...
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