Closed uchisako closed 7 years ago
Thank you! does it work multi line query such as this?
SELECT
foo
FROM
bar
I think it is OK.
Here is a simple test code.
rows = []
rows[0] = "SELECT00"
rows[1] = "selector2001"
rows[2] = "SELECT
foo
FROM
bar"
rows[3] = "SELECT foo FROM bar"
rows[4] = "select\r\n foo\r\nfrom\r\n bar"
rows[5] = "select\n foo\nfrom\n bar"
rows.each do |row|
if row.match(/^SELECT(\s+)/i)
print "*** select detect ***\n"
print "`#{row}`\n\n"
end
end
and results
*** select detect ***
`SELECT
foo
FROM
bar`
*** select detect ***
`SELECT foo FROM bar`
*** select detect ***
`select
foo
from
bar`
*** select detect ***
`select
foo
from
bar`
Thank you for testing!
I got warning when query result has a value starts with
select
.ex.
selector2001
And It's happened by find nested query.
I added a
white space
condition withSELECT
.