[MXS-2550] qlafilter escapes newline with two quotes and a space Created: 2019-06-07  Updated: 2019-06-18  Resolved: 2019-06-18

Status: Closed
Project: MariaDB MaxScale
Component/s: qlafilter
Affects Version/s: 2.3.6
Fix Version/s: 2.3.9

Type: Bug Priority: Critical
Reporter: Kadir Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MXS-1511 Escape newlines in qlafilter output Closed

 Description   

The default value for the qlafilter newline replacement is `" "` (two quotes separated by a space). This was not always so and changed in commit 013dfa7. Before 013dfa7 the default behavior was a simple space: ` ` and implemented with relation to ticket MXS-1511.

But the current default behavior leads to wrong quoted queries.

# Executed query
SELECT
  c.id,
  c.name
FROM
  car AS c
WHERE
  c.type = 'porsche'

# with default behavior `" "` as newline replacement
SELECT" "  c.id," "  c.name" "FROM" "  car AS c" "WHERE" "  c.type = 'porsche'

# with previous behavior ` ` as newline replacement
SELECT   c.id,   c.name FROM   car AS c WHERE   c.type = 'porsche'

This seems to be a bug but can be easily prevented by adding newline_replacement=" ".

@markus. I also have a question before I implement this config change. What was the intention of the change in 013dfa7, the behavior before that seemed already the right one. Is there some detail I am missing?



 Comments   
Comment by markus makela [ 2019-06-18 ]

The parameter expects a quoted string as an argument but the code that uses it doesn't take the quotes out.

Generated at Thu Feb 08 04:14:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.