使用mysql的系统中常见sql错误

使用mysql的系统中常见的sql错误:

 

1.事务中某些表是非innodb类型。

 

SQLWarning ignored:

SQL state 'HY000', error code '1592',

 

message [Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction.]

 

 

2.表中的列为特定类型,而所插入的数据类型没与其字段一一对应

 

SQLWarning ignored:

SQL state '01000', error code '1265',

message [Data truncated for column 'f_birthday' at row 1]

 

 

3. 连接数已达到pool的上限,无法再创建新的连接。

 

Could not get JDBC Connection;

nested exception is com.atomikos.jdbc.AtomikosSQLException: Failed to grow the connection pool

 

 

4. 连接数用尽

 

Data source rejected establishment of connection, 

message from server: "Too many connections"

 

 

5. 未知的XID(分布式事务错误)

 

SQLWarning ignored: SQL state 'HY000',

error code '1397',

message [XAER_NOTA: Unknown XID]

 

 

6. 初步判断:数据源状态异常,导致分布式事务无法将该数据源添加到global transaction中。

 

com.atomikos.datasource.ResourceException: XA resource 'db/dataSourceDefault':

resume for XID '746D2D706C6174666F726D30303036303030303031:746D2D706C6174666F726D3539' raised -9:

the XA resource is currently involved in a local (non-XA) transaction

 

 

 7.数据源状态异常,连接错误等引起的

 

com.atomikos.datasource.ResourceException: XA resource 'db/dataSourceDefault': resume for XID '746D2D706C6174666F726D30303032393030303031: 

746D2D706C6174666F726D3239' raised -7: the XA resource has become unavailable

 

8.[Err] 1292 - Truncated incorrect DOUBLE value

 

error sql:

update shop
set shop_name = '又及' and nick_name = '又及'
where shop_id = 10002

 

right sql:

update shop
set shop_name = '又及' , nick_name = '又及'
where shop_id = 10002

 

 

你可能感兴趣的:(mysql)