Skip to content

SQLServer delete throw exception. delete sql is not supported with 'with(rowlock)' #11260

@galfordliu

Description

@galfordliu

execute delete sql for Sqlserver2014 by mybatis

SQL:
delete from mas_forbiddenMobile with(rowlock) where forbiddenMobile=#{mobile}

it throw exception. delete sql is not supported with 'with(rowlock)'

Affected Version

all Druid version. Latest version 1.2.6

Description

SqlServer 2014
Druid 1.2.6
jdbc mssql-jdbc-9.2.1.jre8

org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: java.sql.SQLException: sql injection violation, dbType sqlserver, , druid-version 1.2.5, syntax error: syntax error, error in :'with(rowlock) where forbiddenMobile', expect AS, actual null, pos 44, line 1, column 38, token IDENTIFIER rowlock : delete from mas_forbiddenMobile with(rowlock) where forbiddenMobile=?

The error occurred while executing an update ### SQL: delete from mas_forbiddenMobile with(rowlock) where forbiddenMobile=? ### Cause: java.sql.SQLException: sql injection violation, dbType sqlserver, , druid-version 1.2.6, syntax error: syntax error, error in :'with(rowlock) where forbiddenMobile', expect AS, actual null, pos 44, line 1, column 38, token IDENTIFIER rowlock : delete from mas_forbiddenMobile with(rowlock) where forbiddenMobile=?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions