MySQL is a special condition. The string is divided by 0 results.

Source: Internet
Author: User

SELECT * Form user where username = '/1;

At first, I thought it was the wrong grammar ....

Results come out a bunch of results.

The original condition is ' divide by 1 '

"What's the result of dividing by 1?"

It turns out that there is an implicit conversion in MySQL (priority conversion)

String conversion Result:

' ABC ' converted to 0

' 25a ' converted to 25

' 123 ' converted to 123

"is also a string so convert to 0

"/1 equals 0/1 so 0 divided by 1 equals 0.

Similarly: The username field is 0 as long as it is a pure string.

so The result of username = '/1 is: as long as the username is a pure string, it will appear in the result.

PS: Think select * Form user where username = '/0;

xdjg5rcuhd7gemxjaaybgctjnjjkjdlubd6excqvcrglpzmlufk50ib9qyimpsi7qy5e1jm8s8exfbsigrg9xyaelhptltscba+ if7wradvanrgt5xnvmx8elimajjabcbz9jqfxfxb12salnimrrvrqo1cwdeeitdbrlz6w/kafk8yua5iy25/+cpylqdd2efejgjz4ysjgqqtp+ vjeknds/ Mgsgnhdoulfeglovfscjfnhkgmpw79tgwzhjrqbzof4bcgxj9uvsvvikcwuc6elcv95kbckt7x44sp3xzqope4oqfqhgzkrmtoynww2ogvfrsorec2wjg +dpfcl3fzanjfvfjvew9+d/it+ykdjexzbmv2xusrq3+nynr/eklvmoy1x4km=

MySQL is a special condition. The string is divided by the result of 0.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.