There is an article about SQL injection: Abusing MySQL string arithmetic for tiny SQL injections
The question is, what is the meaning of select ''-'' ? I try it with MySQL, and it returns:
mysql> select ''-'';
+-------+
| ''-'' |
+-------+
| 0 |
+-------+
1 row in set (0.00 sec)
What happend? What means that 0?
And the result of select '-':
mysql> select '-';
+---+
| - |
+---+
| - |
+---+
1 row in set (0.00 sec)
I am very confused about these result.
You are minus
-from one empty string''to other:See following:
But warning if its not a number string:
Two warnings:
Why no warning for
emptystring?Where as there is no warning for empty string because its(casted something)
0see below:hence by doing
''-''you are doing0 - 0To be more clear I am adding following example (I feels will be helpful to you):
How conversion happen:
notice its conversion:
''converted into0,'0'converted into0but''not equals to'0'