v.7.00.4312 ALL OK !
New werions:
1. got stored proc, inside:
select distinct(field)
from table
WHERE data not REGEXP '^(-|+){0,1}([0-9]+.[0-9]*|[0-9]*.[0-9]+|[0-9]+)$';
--> SQL Error (1139): Got error 'repetition-operator operand invalid' from regexp
besides, note, doh not tested, I guess this:
SET str = CONCAT(str,'where data REGEXP '^[0-9]{2}$'');
should be escaped ? It does not have to be, it works anyway on 7.00.4312.
Mayor problem - reverted to prev. versions.
I cannot fully understand what you're trying to tell here, but I highly guess you are running into a server bug:
http://bugs.mysql.com/bug.php?id=58342
http://bugs.mysql.com/bug.php?id=62129
Right?
http://bugs.mysql.com/bug.php?id=58342
http://bugs.mysql.com/bug.php?id=62129
Right?
Hmm possible, server error. Strange manifestation. Running things for 3+ months, all OK. Only editor HSQL. Looks like it eats out '\' charater.
And then you see code like this:
SET str = CONCAT(str,'where data REGEXP '^[0-9]{2}$'');
escape character missing.
Open (and you opened presumably good code), add space, to enable save, cick and it reports error.
Thanks.
I do not know how that happened. I did many changes to stored proc, saved it and all was OK.
And then you see code like this:
SET str = CONCAT(str,'where data REGEXP '^[0-9]{2}$'');
escape character missing.
Open (and you opened presumably good code), add space, to enable save, cick and it reports error.
Thanks.
I do not know how that happened. I did many changes to stored proc, saved it and all was OK.
See forinstance this two regex expressions. The upper (from backup) is good, the lower is corrupt. I did nothing to it 100% sure. In the same way all other strings in stored proc were 'destroyed'.
'^(-|\\+){0,1}([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+|[0-9]+)$'
'^(-|\+){0,1}([0-9]+\.[0-9]*|[0-9]*\.[0-9]+|[0-9]+)$'
There are only 2 posibilites what dit this here, server or client
'^(-|\\+){0,1}([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+|[0-9]+)$'
'^(-|\+){0,1}([0-9]+\.[0-9]*|[0-9]*\.[0-9]+|[0-9]+)$'
There are only 2 posibilites what dit this here, server or client
I get the same error when I run your select query from the official command-line client:
If you are looking for a literal + you need to escape it:
mysql> select distinct(field)
-> from `table`
-> WHERE data not REGEXP '^(-|+){0,1}([0-9]+.[0-9]*|[0-9]*.[0-9]+|[0-9]+)$';
ERROR 1139 (42000): Got error 'repetition-operator operand invalid' from regexp
If you are looking for a literal + you need to escape it:
mysql> select * from `table` WHERE data not REGEXP '(-|+){1}';
ERROR 1139 (42000): Got error 'repetition-operator operand invalid' from regexp
mysql> select * from `table` WHERE data not REGEXP '(-|\\+){1}';
Empty set (0.00 sec)
column routine_definition, omits one quote when the original text included escaped quotes ... typical case dynamic sql ...
I that cases ' dissapear via dynamic sql.
Point is, I had plain sql in stored proc, like:
select * from `table` WHERE data not REGEXP '(-|\\+){1}';
saved it, not changed a bit, a zilion times
and then with no reason it appeared saved like (minus 1 \):
select * from `table` WHERE data not REGEXP '(-|\+){1}';
See issue #3107.
Please login to leave a reply, or register at first.