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
49ef59d6
Commit
49ef59d6
authored
Feb 10, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/home/cps/mysql/devel/5.1-utf-bug
parents
094fcd26
135ea05c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
13 deletions
+49
-13
mysql-test/r/log_tables.result
mysql-test/r/log_tables.result
+12
-0
mysql-test/t/log_tables.test
mysql-test/t/log_tables.test
+18
-0
sql/log.cc
sql/log.cc
+13
-10
sql/log.h
sql/log.h
+6
-3
No files found.
mysql-test/r/log_tables.result
View file @
49ef59d6
...
...
@@ -52,3 +52,15 @@ select "Mark that we woke up from TRUNCATE in the test"
as "test passed";
test passed
Mark that we woke up from TRUNCATE in the test
use test;
truncate table mysql.general_log;
set names utf8;
create table bug16905 (s char(15) character set utf8 default 'пусто');
insert into bug16905 values ('новое');
select * from mysql.general_log;
event_time user_host thread_id server_id command_type argument
TIMESTAMP root[root] @ localhost [] 2 1 Query set names utf8
TIMESTAMP root[root] @ localhost [] 2 1 Query create table bug16905 (s char(15) character set utf8 default 'пусто')
TIMESTAMP root[root] @ localhost [] 2 1 Query insert into bug16905 values ('новое')
TIMESTAMP root[root] @ localhost [] 2 1 Query select * from mysql.general_log
drop table bug16905;
mysql-test/t/log_tables.test
View file @
49ef59d6
...
...
@@ -144,7 +144,25 @@ reap;
select
"Mark that we woke up from TRUNCATE in the test"
as
"test passed"
;
connection
con1
;
disconnect
con2
;
use
test
;
#
# Bug #16905 Log tables: unicode statements are logged incorrectly
#
truncate
table
mysql
.
general_log
;
set
names
utf8
;
create
table
bug16905
(
s
char
(
15
)
character
set
utf8
default
'пусто'
);
insert
into
bug16905
values
(
'новое'
);
--
replace_column
1
TIMESTAMP
select
*
from
mysql
.
general_log
;
drop
table
bug16905
;
disconnect
con1
;
--
enable_ps_protocol
sql/log.cc
View file @
49ef59d6
...
...
@@ -311,7 +311,8 @@ bool Log_to_csv_event_handler::
log_general
(
time_t
event_time
,
const
char
*
user_host
,
uint
user_host_len
,
int
thread_id
,
const
char
*
command_type
,
uint
command_type_len
,
const
char
*
sql_text
,
uint
sql_text_len
)
const
char
*
sql_text
,
uint
sql_text_len
,
CHARSET_INFO
*
client_cs
)
{
TABLE
*
table
=
general_log
.
table
;
...
...
@@ -326,11 +327,11 @@ bool Log_to_csv_event_handler::
/* set default value (which is CURRENT_TIMESTAMP) */
table
->
field
[
0
]
->
set_null
();
table
->
field
[
1
]
->
store
(
user_host
,
user_host_len
,
&
my_charset_latin1
);
table
->
field
[
1
]
->
store
(
user_host
,
user_host_len
,
client_cs
);
table
->
field
[
2
]
->
store
((
longlong
)
thread_id
);
table
->
field
[
3
]
->
store
((
longlong
)
server_id
);
table
->
field
[
4
]
->
store
(
command_type
,
command_type_len
,
&
my_charset_latin1
);
table
->
field
[
5
]
->
store
(
sql_text
,
sql_text_len
,
&
my_charset_latin1
);
table
->
field
[
4
]
->
store
(
command_type
,
command_type_len
,
client_cs
);
table
->
field
[
5
]
->
store
(
sql_text
,
sql_text_len
,
client_cs
);
table
->
file
->
ha_write_row
(
table
->
record
[
0
]);
reenable_binlog
(
current_thd
);
...
...
@@ -376,6 +377,7 @@ bool Log_to_csv_event_handler::
{
/* table variables */
TABLE
*
table
=
slow_log
.
table
;
CHARSET_INFO
*
client_cs
=
thd
->
variables
.
character_set_client
;
DBUG_ENTER
(
"log_slow_to_csv"
);
...
...
@@ -396,7 +398,7 @@ bool Log_to_csv_event_handler::
table
->
field
[
0
]
->
set_null
();
/* store the value */
table
->
field
[
1
]
->
store
(
user_host
,
user_host_len
,
&
my_charset_latin1
);
table
->
field
[
1
]
->
store
(
user_host
,
user_host_len
,
client_cs
);
if
(
query_start_arg
)
{
...
...
@@ -419,7 +421,7 @@ bool Log_to_csv_event_handler::
if
(
thd
->
db
)
/* fill database field */
table
->
field
[
6
]
->
store
(
thd
->
db
,
thd
->
db_length
,
&
my_charset_latin1
);
table
->
field
[
6
]
->
store
(
thd
->
db
,
thd
->
db_length
,
client_cs
);
else
table
->
field
[
6
]
->
set_null
();
...
...
@@ -437,8 +439,7 @@ bool Log_to_csv_event_handler::
table
->
field
[
9
]
->
store
((
longlong
)
server_id
);
/* sql_text */
table
->
field
[
10
]
->
store
(
sql_text
,
sql_text_len
,
&
my_charset_latin1
);
table
->
field
[
10
]
->
store
(
sql_text
,
sql_text_len
,
client_cs
);
/* write the row */
table
->
file
->
ha_write_row
(
table
->
record
[
0
]);
...
...
@@ -494,7 +495,8 @@ bool Log_to_file_event_handler::
log_general
(
time_t
event_time
,
const
char
*
user_host
,
uint
user_host_len
,
int
thread_id
,
const
char
*
command_type
,
uint
command_type_len
,
const
char
*
sql_text
,
uint
sql_text_len
)
const
char
*
sql_text
,
uint
sql_text_len
,
CHARSET_INFO
*
client_cs
)
{
return
mysql_log
.
write
(
event_time
,
user_host
,
user_host_len
,
thread_id
,
command_type
,
command_type_len
,
...
...
@@ -810,7 +812,8 @@ bool LOGGER::general_log_print(THD *thd, enum enum_server_command command,
user_host_len
,
id
,
command_name
[(
uint
)
command
].
str
,
command_name
[(
uint
)
command
].
length
,
message_buff
,
message_buff_len
)
||
error
;
message_buff
,
message_buff_len
,
thd
->
variables
.
character_set_client
)
||
error
;
unlock
();
}
return
error
;
...
...
sql/log.h
View file @
49ef59d6
...
...
@@ -368,7 +368,8 @@ class Log_event_handler
virtual
bool
log_general
(
time_t
event_time
,
const
char
*
user_host
,
uint
user_host_len
,
int
thread_id
,
const
char
*
command_type
,
uint
command_type_len
,
const
char
*
sql_text
,
uint
sql_text_len
)
=
0
;
const
char
*
sql_text
,
uint
sql_text_len
,
CHARSET_INFO
*
client_cs
)
=
0
;
virtual
~
Log_event_handler
()
{}
};
...
...
@@ -403,7 +404,8 @@ class Log_to_csv_event_handler: public Log_event_handler
virtual
bool
log_general
(
time_t
event_time
,
const
char
*
user_host
,
uint
user_host_len
,
int
thread_id
,
const
char
*
command_type
,
uint
command_type_len
,
const
char
*
sql_text
,
uint
sql_text_len
);
const
char
*
sql_text
,
uint
sql_text_len
,
CHARSET_INFO
*
client_cs
);
bool
flush
(
THD
*
thd
,
TABLE_LIST
*
close_slow_Log
,
TABLE_LIST
*
close_general_log
);
void
close_log_table
(
uint
log_type
,
bool
lock_in_use
);
...
...
@@ -431,7 +433,8 @@ class Log_to_file_event_handler: public Log_event_handler
virtual
bool
log_general
(
time_t
event_time
,
const
char
*
user_host
,
uint
user_host_len
,
int
thread_id
,
const
char
*
command_type
,
uint
command_type_len
,
const
char
*
sql_text
,
uint
sql_text_len
);
const
char
*
sql_text
,
uint
sql_text_len
,
CHARSET_INFO
*
client_cs
);
void
flush
();
void
init_pthread_objects
();
};
...
...
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