Multi-line queries with first line being the comment are not parsed correctly

Bug #1111215 reported by Ovais Tariq on 2013-01-31
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MOVED - Percona Playback
Undecided
Vlad Lesin

Bug Description

The trunk version incorrectly parses multi-line queries which have a comment in the first line. It looks like percona-playback removes the newlines from the query and so the whole query becomes a comment.

Sample slow-log entry:
# Time: 130131 2:14:52
# User@Host: root[root] @ localhost []
# Thread_id: 3 Schema: test Last_errno: 0 Killed: 0
# Query_time: 0.000330 Lock_time: 0.000176 Rows_sent: 3 Rows_examined: 3 Rows_affected: 0 Rows_read: 3
# Bytes_sent: 149 Tmp_tables: 0 Tmp_disk_tables: 0 Tmp_table_sizes: 0
# InnoDB_trx_id: 20A0B
SET timestamp=1359616644;
-- this is the first line of the query which is a comment
select * from t1 where i between 78 and 80;

When Percona-playback is run and slow-logging is enabled using long_query_time=0, following is what I see in the slow log:
# Time: 130131 2:42:15
# User@Host: root[root] @ localhost [127.0.0.1]
# Thread_id: 30 Schema: test Last_errno: 0 Killed: 0
# Query_time: 0.000022 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 Rows_affected: 0 Rows_read: 0
# Bytes_sent: 11 Tmp_tables: 0 Tmp_disk_tables: 0 Tmp_table_sizes: 0
SET timestamp=1359618135;
-- this is the first line of the query which is a comment select * from t1 where i between 78 and 80;

You can see that the newline is removed from the query and hence the whole query becomes a comment.

This is not repeatable with version 0.5, but is repeatable with trunk version.

Test data and slow log to reproduce this issue are attached.

Ovais Tariq (ovais-tariq) wrote :
Vlad Lesin (vlad-lesin) on 2013-02-01
Changed in percona-playback:
assignee: nobody → Vlad Lesin (vlad-lesin)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments