First INSERT query will be executed without any errors. charval field will be complemented to 10 symbols with spaces.
Second INSERT query will run smoothly as well - but 2extra spaces will be truncated in that case.
Third INSERT query will not succeed though. Non-space symbols cannot be truncated during insertion into char and varchar fields.
Query #1 will return 2
Following DELETE query will delete one record. Trailing spaces are ignored during char-values comparison. Therefore, charval='aaaaaa'
condition will be evaluated to True for ('aaaaaa ','aaa')
record.
Query #2 will return "1"
Comparison in the third query will evaluate to True for the same reason. ('aaa','aaa')
record meets its condition.
Query #3 will return "1"
Войдите чтобы поставить Нравится
Войдите чтобы прокомментировать