Home > Back-end >  Mybatis execution results do not agree with mysql tools execution results
Mybatis execution results do not agree with mysql tools execution results

Time:09-19

In the recent development, use mybatis discovered A strange phenomenon, is A simple premise condition, make table a. field 1 between table b. field 1 and table b. logic field between the two, and then when I finish after

At the time of the test, found that the result is not right, anyway
Article 6 in mybatis data
Article 7 in mysql data
Then began to find the reason. Will mybatis log that executes the SQL statements in mysql, found that there are 7 data, only six data in the code, it makes me doubt about

Then I found the table structure found in table B field 1 and 2 is of type varchar, no reaction to come over at one fell swoop.
(in general, the SQL statement in the code. Can write well in the mysql link tool then in copy the code, change the parameters. So most of the attention has focused on and on)


So what lead to this problem? Cause in mysql tools can bewteen string type number, the correct results
The same bewteen in mybatis cannot correct results in

CodePudding user response:

You can put the code that executes in mybatis coming through the debug mode, comparing to your own code to perform in the SQL execution compare to know.

CodePudding user response:

So, still doubt is the problem of code logic, or put the code posted?

CodePudding user response:

1. You can use some tools will you execute SQL statements to print out, if you are using the idea, and have the print Log, you can use Mybatis Log Plugin,
2. If not, can only print log,
3. In Mybatis source view you execution of SQL statement is what

CodePudding user response:

Thank you, I'm sorry, is I don't have described condition clearly.


The following is the specific situation:
The specific circumstances

  • Related