Skip to content
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

[错误报告]: 生成的sql错误 #6661

Open
3 tasks done
yulichang opened this issue Jan 12, 2025 · 0 comments
Open
3 tasks done

[错误报告]: 生成的sql错误 #6661

yulichang opened this issue Jan 12, 2025 · 0 comments

Comments

@yulichang
Copy link

确认

  • 我使用的版本是最新版, 并且使用插件确认过项目里无依赖版本冲突
  • 我已经在 issue 中搜索过, 确认问题没有被提出过
  • 我已经修改标题, 将标题中的 描述 替换为遇到的问题

当前程序版本

3.5.10

问题描述

代码

    @Select("""
            <script>
                select * from `user`
                <where>
                    <if test="true">
                        1=1
                    </if>
                    and 2=2
                    <if test="true">
                        and 3=3
                    </if>
                </where>
            </script>
            """)
    List<Map<String, Object>> test();

生成sql

select * from `user` WHERE 1=1and 2=2and 3=3

and 2=2前后缺少空格

正确的sql应该是

select * from `user` WHERE 1=1 and 2=2 and 3=3

使用3.5.9没问题,原生mybatis:3.5.19也没问题

应该是这里改出的问题
eddde54#diff-c2e89b02c95139afd78ac601427433fa9aa044985ecc89fb9f2528eae9a39fb1L445

详细堆栈日志

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant