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

Bug #1111215 reported by Ovais Tariq
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MOVED - Percona Playback
New
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.

Tags: issue-29128
Revision history for this message
Ovais Tariq (ovais-tariq) wrote :
Vlad Lesin (vlad-lesin)
Changed in percona-playback:
assignee: nobody → Vlad Lesin (vlad-lesin)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.