Home > Software engineering >  pt-kill not working for multiple line query
pt-kill not working for multiple line query

Time:08-03

This is my below query, In the match-info in pt-kill, should be combined from starting and endpoint word of the Query. Not the SELECT only.

Here SELECT is starting word and tn is the ending word of the query.

Multiple line query

SELECT *
 FROM 
table_name
 as tn;

I have tried the below match-info, but it is working only a single line of the query.

'(^SELECT. tn$)'

Please suggest the match info in pt-kill which should be combined of beginning and end of the query

CodePudding user response:

. doesn't match newlines by default. Put (?s) at the beginning of the regexp to set the dotall flag to override this.

Also, there's a ; at the end, you may need to include that in the match info.

(?s)^SELECT.*tn;$
  • Related