Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0.16
-
None
Description
When I start a statement with binary data the column INFO of information_schema.processlist is truncated at the first byte > 128. show full processlist shows the full query in it's Info column.
My test query is generated and run by this perl script:
perl -e "use DBI; $dbh = DBI->connect(qw(dbi:mysql:host=myhost;database=mydb myuser mypass)); $dbh->do(qq{select sleep(30+0*?)}, undef, join '', map chr, 0..255);"
|
While the sleep is still asleep, use
select * from information_schema.processlist; |
show full processlist; |
or look at the info column specifically:
select info from information_schema.processlist where state = 'User sleep'; |
. With
select char_length(info), length(info) from information_schema.processlist where state = 'User sleep'; |
which results in
154 154
|
you can verify that the values are truncated inside the server, this is not a problem with the client connection or the client.
For comparison use
perl -e "use DBI; $dbh = DBI->connect(qw(dbi:mysql:host=myhost;database=mydb myuser mypass)); $dbh->do(qq{select sleep(30+0*?)}, undef, join '', map chr, map $_ % 128, 0..255);"
|
and
select char_length(info), length(info) from information_schema.processlist where state = 'User sleep'; |
with the result
291 291
|
The character set settings are:
'character_set_client', 'utf8'
|
'character_set_connection', 'utf8'
|
'character_set_database', 'latin1'
|
'character_set_filesystem', 'binary'
|
'character_set_results', 'utf8'
|
'character_set_server', 'latin1'
|
'character_set_system', 'utf8'
|
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Description |
When I start a statement with binary data the column INFO of information_schema.processlist is truncated at the first byte > 128. show full processlist shows the full query in it's Info column. My test query is generated and run by this perl script: perl -e "use DBI; $dbh = DBI->connect(qw(dbi:mysql:host=myhost;database=mydb myuser mypass)); $dbh->do(qq{select sleep(30+0*?)}, undef, join '', map chr, 0..255);" While the sleep is still asleep, use select * from information_schema.processlist; show full processlist; or look at the info column specifically: select info from information_schema.processlist where state = 'User sleep'; . With select char_length(info), length(info) from information_schema.processlist where state = 'User sleep'; which results in 154 154 you can verify that the values are truncated inside the server, this is not a problem with the client connection or the client. For comparison use perl -e "use DBI; $dbh = DBI->connect(qw(dbi:mysql:host=myhost;database=mydb myuser mypass)); $dbh->do(qq{select sleep(30+0*?)}, undef, join '', map chr, map $_ % 128, 0..255);" and select char_length(info), length(info) from information_schema.processlist where state = 'User sleep'; with the result 291 291 The character set settings are: 'character_set_client', 'utf8' 'character_set_connection', 'utf8' 'character_set_database', 'latin1' 'character_set_filesystem', 'binary' 'character_set_results', 'utf8' 'character_set_server', 'latin1' 'character_set_system', 'utf8' |
When I start a statement with binary data the column INFO of information_schema.processlist is truncated at the first byte > 128. show full processlist shows the full query in it's Info column. My test query is generated and run by this perl script: {noformat} perl -e "use DBI; $dbh = DBI->connect(qw(dbi:mysql:host=myhost;database=mydb myuser mypass)); $dbh->do(qq{select sleep(30+0*?)}, undef, join '', map chr, 0..255);" {noformat} While the sleep is still asleep, use {noformat} select * from information_schema.processlist; show full processlist; {noformat} or look at the info column specifically: {noformat} select info from information_schema.processlist where state = 'User sleep'; {noformat} . With {noformat} select char_length(info), length(info) from information_schema.processlist where state = 'User sleep'; {noformat} which results in {noformat} 154 154 {noformat} you can verify that the values are truncated inside the server, this is not a problem with the client connection or the client. For comparison use {noformat} perl -e "use DBI; $dbh = DBI->connect(qw(dbi:mysql:host=myhost;database=mydb myuser mypass)); $dbh->do(qq{select sleep(30+0*?)}, undef, join '', map chr, map $_ % 128, 0..255);" {noformat} and {noformat} select char_length(info), length(info) from information_schema.processlist where state = 'User sleep'; {noformat} with the result {noformat} 291 291 {noformat} The character set settings are: {noformat} 'character_set_client', 'utf8' 'character_set_connection', 'utf8' 'character_set_database', 'latin1' 'character_set_filesystem', 'binary' 'character_set_results', 'utf8' 'character_set_server', 'latin1' 'character_set_system', 'utf8' {noformat} |
Due Date | 2015-04-20 |
Description |
When I start a statement with binary data the column INFO of information_schema.processlist is truncated at the first byte > 128. show full processlist shows the full query in it's Info column. My test query is generated and run by this perl script: {noformat} perl -e "use DBI; $dbh = DBI->connect(qw(dbi:mysql:host=myhost;database=mydb myuser mypass)); $dbh->do(qq{select sleep(30+0*?)}, undef, join '', map chr, 0..255);" {noformat} While the sleep is still asleep, use {noformat} select * from information_schema.processlist; show full processlist; {noformat} or look at the info column specifically: {noformat} select info from information_schema.processlist where state = 'User sleep'; {noformat} . With {noformat} select char_length(info), length(info) from information_schema.processlist where state = 'User sleep'; {noformat} which results in {noformat} 154 154 {noformat} you can verify that the values are truncated inside the server, this is not a problem with the client connection or the client. For comparison use {noformat} perl -e "use DBI; $dbh = DBI->connect(qw(dbi:mysql:host=myhost;database=mydb myuser mypass)); $dbh->do(qq{select sleep(30+0*?)}, undef, join '', map chr, map $_ % 128, 0..255);" {noformat} and {noformat} select char_length(info), length(info) from information_schema.processlist where state = 'User sleep'; {noformat} with the result {noformat} 291 291 {noformat} The character set settings are: {noformat} 'character_set_client', 'utf8' 'character_set_connection', 'utf8' 'character_set_database', 'latin1' 'character_set_filesystem', 'binary' 'character_set_results', 'utf8' 'character_set_server', 'latin1' 'character_set_system', 'utf8' {noformat} |
When I start a statement with binary data the column INFO of information_schema.processlist is truncated at the first byte > 128. show full processlist shows the full query in it's Info column. My test query is generated and run by this perl script: {noformat} perl -e "use DBI; $dbh = DBI->connect(qw(dbi:mysql:host=myhost;database=mydb myuser mypass)); $dbh->do(qq{select sleep(30+0*?)}, undef, join '', map chr, 0..255);" {noformat} While the sleep is still asleep, use {code:sql} select * from information_schema.processlist; show full processlist; {code} or look at the info column specifically: {code:sql} select info from information_schema.processlist where state = 'User sleep'; {code} . With {code:sql} select char_length(info), length(info) from information_schema.processlist where state = 'User sleep'; {code} which results in {noformat} 154 154 {noformat} you can verify that the values are truncated inside the server, this is not a problem with the client connection or the client. For comparison use {noformat} perl -e "use DBI; $dbh = DBI->connect(qw(dbi:mysql:host=myhost;database=mydb myuser mypass)); $dbh->do(qq{select sleep(30+0*?)}, undef, join '', map chr, map $_ % 128, 0..255);" {noformat} and {code:sql} select char_length(info), length(info) from information_schema.processlist where state = 'User sleep'; {code} with the result {noformat} 291 291 {noformat} The character set settings are: {noformat} 'character_set_client', 'utf8' 'character_set_connection', 'utf8' 'character_set_database', 'latin1' 'character_set_filesystem', 'binary' 'character_set_results', 'utf8' 'character_set_server', 'latin1' 'character_set_system', 'utf8' {noformat} |
Assignee | Alexander Barkov [ bar ] |
Fix Version/s | 10.0 [ 16000 ] |
Fix Version/s | 10.1 [ 16100 ] | |
Fix Version/s | 10.0 [ 16000 ] |
Assignee | Alexander Barkov [ bar ] | Sergei Golubchik [ serg ] |
Status | Open [ 1 ] | In Review [ 10002 ] |
Assignee | Sergei Golubchik [ serg ] | Alexander Barkov [ bar ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Component/s | OTHER [ 10125 ] | |
Fix Version/s | 10.1.5 [ 18813 ] | |
Fix Version/s | 10.1 [ 16100 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Component/s | Character Sets [ 10801 ] | |
Component/s | OTHER [ 10125 ] |
Workflow | MariaDB v2 [ 60167 ] | MariaDB v3 [ 67377 ] |
Workflow | MariaDB v3 [ 67377 ] | MariaDB v4 [ 148915 ] |
I think that's what happening: your character_set_client is utf8, the query is expected to be a valid utf8 string. But it is not. The 'info' column of the information_schema.processlist is also utf8. When the server tries to convert an invalid utf8 string to a valid utf8 string — you get a truncation at the first invalid character.