为什么成功的UPDATE返回-1行会受到影响?

时间:2018-09-01 06:00:58

标签: jdbc clojure mariadb

我正在使用

  • Clojure 1.9.0
  • org.clojure / java.jdbc 0.7.8
  • MariaDB 10.3.9
  • org.mariadb.jdbc / mariadb-java-client 2.2.6

我的驱动程序/连接字符串是:

GetType(Dictionary(Of String, String)).MatchesGenericType(Nothing) 'Throws exception
GetType(Dictionary(Of String, String)).MatchesGenericType(GetType(String)) 'Throws exception
GetType(Dictionary(Of String, String)).MatchesGenericType(GetType(List(Of String))) 'Returns False
GetType(Dictionary(Of String, String)).MatchesGenericType(GetType(Dictionary(Of String, String))) 'Returns True
GetType(Dictionary(Of String, String)).MatchesGenericType(GetType(Dictionary(Of ,))) 'Returns True
GetType(Dictionary(Of ,)).MatchesGenericType(GetType(Dictionary(Of String, String))) 'Returns False
GetType(Dictionary(Of ,)).MatchesGenericType(GetType(Dictionary(Of ,))) 'Returns True

我有一个表(def db {:classname "org.mariadb.jdbc.Driver" :subprotocol "mariadb" :subname "//127.0.0.1:3306/dbname" :user "username" :password "password"}) ,其中有列examplescomment

查询正常进行:

user

下面的语句成功修改了数据库中的行,但始终返回(jdbc/query db ["select * from examples") ;=> ({:user "existing user", :comment "example comment"}) 代替受影响的行数:

-1

在上述操作之后立即显式调用(jdbc/execute! db ["update examples set comment = ? where user = ?" "test comment" "existing user"]) ;=> (-1) 会返回相同的结果:

row_count()

等效命令在mariadb(“ (jdbc/query db ["select row_count()"]) => ({:row_count() -1}) ”)外壳中给出正确的结果。

我在做什么错了?

0 个答案:

没有答案