x rows affected or returned

本文记录了一次SQL更新操作的日志情况,通过查看受影响的行数来判断更新操作是否成功执行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

     log中有这样一条语句:

[2019-03-23 12:39:41]  [0.49ms]  update xxx_tab set y = 2 where status = 3

      那么,这个set y = 2到底成功了没有呢? 别猜,看:

[2019-03-23 12:39:41]  [0.49ms]  update xxx_tab set y = 2 where status = 3
[0 rows affected or returned ] 

 

      因这个信息, 可以发现问题, 并确认了一个bug.

 

 

[root@hadoop01 hive]# bin/schematool -dbType mysql -initSchema -verbose SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/opt/programs/apache-hive-2.3.9-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/programs/hadoop-2.7.6/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] Metastore connection URL: jdbc:mysql://hadoop01:3306/hive?useSSL=false Metastore Connection Driver : com.mysql.jdbc.Driver Metastore connection User: root Starting metastore schema initialization to 2.3.0 Initialization script hive-schema-2.3.0.mysql.sql Connecting to jdbc:mysql://hadoop01:3306/hive?useSSL=false Connected to: MySQL (version 8.0.42) Driver: MySQL Connector Java (version mysql-connector-java-5.1.48 ( Revision: 29734982609c32d3ab7e5cac2e6acee69ff6b4aa )) Transaction isolation: TRANSACTION_READ_COMMITTED 0: jdbc:mysql://hadoop01:3306/hive> !autocommit on Autocommit status: true 0: jdbc:mysql://hadoop01:3306/hive> /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */ No rows affected (0.004 seconds) 0: jdbc:mysql://hadoop01:3306/hive> /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */ No rows affected (0 seconds) 0: jdbc:mysql://hadoop01:3306/hive> /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */ No rows affected (0 seconds) 0: jdbc:mysql://hadoop01:3306/hive> /*!40101 SET NAMES utf8 */ No rows affected (0.003 seconds) 0: jdbc:mysql://hadoop01:3306/hive> /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */ No rows affected (0.002 seconds) 0: jdbc:mysql://hadoop01:3306/hive> /*!40103 SET TIME_ZONE='+00:00' */ No rows affected (0.001 seconds) 0: jdbc:mysql://hadoop01:3306/hive> /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=
最新发布
07-04
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值