The current project is to use MySQL, this is the wrong choice, because it is not a server-client mode project, but a CS architecture project, MySQL This needs more complex configuration of the database is not appropriate. Need should be sqlite this kind of, embedded database.
So recently unified database replacement work, the previous MySQL database operation of all the interface into the SQLite database operation interface.
According to the logic of SQL statements are the same, as long as the use of the database C + + interface can be changed.
Then there is a problem that a table query is always wrong.
After debugging and experimentation, the user IDs in the query statements are all uppercase letters, and the actual database contains lowercase letters.
The query is empty because the string user_id ' f56dc7ad-2aab-499c-a1a5-0efc154e15e2 ' are all uppercase letters.
As a matter of fact:
USER_ID: f56dc7ad-2aab-499c-a1a5-0efc154e15e2, containing lowercase letters
Why wasn't there such a problem in MySQL before?
Because queries in MySQL are not sensitive to letter-case:
It can be seen that even if the letter F is inconsistent in size, it still succeeds in checking the
Finally, the way I solve this problem is to make the original case-sensitive sqlite become case insensitive, so it is consistent with the previous MySQL.
When you build a table:
CREATE TABLE if not exists User_cert (user_id char (+) not NULL COLLATE nocase,cert_id char (+) not null,id integer PR Imary key AutoIncrement);
The special table stipulates that COLLATE nocase will be able.
SQLite query problem, caused by letter-case sensitivity