I'm trying to find mismatching regexp
Consider two tables
foo
Table with testvalues
test_value id --------- -- 10001 test
bar
Table with regexps
test_reg id -------- -- ^([1-9]*)$ test
I try to compare each line vs each lines regexp
SELECT * FROM foo RIGHT JOIN bar ON foo.id=bar.id
WHERE test_value NOT REGEXP CONCAT(bar.test_reg)
This seems to work (at least for values<=9999). But I have a weird issue. If a number jumps above 10001 I do get a match. If I replace the CONCAT(bar.test_reg)
with CONCAT('^([1-9]*)$')
it works as expected. I also tried a self_join with the same result.
SELECT * FROM foo RIGHT JOIN bar ON foo.id=bar.id
AND test_value NOT REGEXP CONCAT(bar.test_reg)
I do guess that the error lies somewhere else (e.g. comparing not each line)