-
Notifications
You must be signed in to change notification settings - Fork 160
修复不使用`将sql的每一行包裹,导致原始sql有换行时生成的sql粘连问题 #586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
select user_id, user_name \n from user )], 生成的sql为 : select user_id, user_namefrom user,修改后生成的sql为:select user_id, user_name from user)
有没有新增 更多场景的测试,貌似单元测试跑失败了 |
Are there any new tests for more scenarios, it seems that the unit test failed |
I'll change it and run the test again |
已更改实现方法,在自己的项目里进行了测试,保留了自定义的sql格式,同时粘连问题也得到了解决 |
The implementation method has been changed, tested in my own project, retained the custom SQL format, and the sticking problem has also been solved |
If you have any questions, close it first |
编译期的sql生成和运行时的动态拼接行为都已更改,动态sql的参数生成格式进行了更改,所以更改了一些测试用例,不影响语法执行 |
The dynamic splicing behavior of SQL generation during the compilation period and the runtime have been changed. The parameter generation format of dynamic SQL has been changed, so some test cases have been changed, which does not affect syntax execution. |
codegen 也会影响html_sql 这块是不是也测试了的? |
Codegen will also affect the html_sql area. Is it also tested? |
是的,我梳理了一遍代码逻辑,pysql也转成了html_sql再执行的,所以再新加的测试用例里有一个就是测试html_sql的,对原来的逻辑没有任何影响,我在自己项目用复杂sql测了一遍 |
Yes, one of the newly added test cases is to test html_sql, which has no effect on the original logic. I used complex sql to test it in my project. |
例:
生成的sql为 :
select user_id, user_namefrom user
修改后生成的sql为:
before generate sql is :
after generate sql is: