Repository navigation
Closed
Labels
dialect: mysqlFor issues and PRs. Things that involve MySQL (and do not involve all dialects).type: bugDEPRECATED: replace with the "bug" issue type
Description
What you are doing?
when i config sequelize log with winston logger with config below:
// 标准日志服务组件...
let wsLogs = require(global.appRoot + '/libs/WsLogs');
let sqlLogger = wsLogs.logger('sql');
let sequelizeOptions = {
operatorsAliases: false,
//operatorsAliases: Op,
// 显示 SQL 警告信息...
showWarnings: true,
//logging: false,
//logging: sqlLogger.verbose,
logging: (msg) => sqlLogger.verbose(msg),
// disable inserting undefined values as NULL
// - default: false
omitNull: false,
...db_config[name]
};I had set options with showWarnings: true to show sql errors,
What do you expect to happen?
when i exe a warning sql,it crashed with error: _warningRow is not iterable,and can't show any warning msg from mysql,how to work around this?
i hava exe this sql in terminal manual:
mysql> INSERT INTO `tours` (`id`,`name`,`city`,`thumb`,`phone1`,`phone2`,`body`,`detail_address`,`traffic_blue`,`traffic_self`,`privilege`,`is_recommend`,`coord_x`,`coord_y`,`tips`,`open_time`,`close_time`,`url`,`level`,`toursn`,`price`,`tey_limits`,`created_at`,`updated_at`) VALUES (10029,'测试景区[10029][F:0][R:0][YL:100][D:0]','xh','http://ekt-userface.oss-cn-shenzhen.aliyuncs.com/20180502/ea4ae9c477c9aa2e415fda6745a7d3b5.jpg','','','','','','','',0,0,0,'','13:30','22:00','http://www.mltc.cn/',0,10029,188,0,'2018-05-01 12:30:00','2018-09-13 16:01:19');
Query OK, 1 row affected, 1 warning (0.01 sec)
mysql> show warnings;
+---------+------+-------------------------------------------+
| Level | Code | Message |
+---------+------+-------------------------------------------+
| Warning | 1265 | Data truncated for column 'name' at row 1 |
+---------+------+-------------------------------------------+
1 row in set (0.01 sec)this is because column name is too long.
What is actually happening?
my environment:
sequelize version 4.38.0;
mysql version 5.7.12;
winston version 3.1.0;
Metadata
Metadata
Assignees
Labels
dialect: mysqlFor issues and PRs. Things that involve MySQL (and do not involve all dialects).type: bugDEPRECATED: replace with the "bug" issue type
Activity
sushantdhiman commentedon Sep 13, 2018
Can you show query that throws warning or reproduce this issue?
zyfmix commentedon Sep 13, 2018
i had update my issue and insert sql.
sushantdhiman commentedon Sep 13, 2018
SSCCE
fix(query): check valid warn message (sequelize#9919)
fix(query): check valid warn message (sequelize#9919)
fix(query): check valid warn message (sequelize#9919)
fix(query): check valid warn message (sequelize#9919)
fix(query): check valid warn message (sequelize#9919)
fix(query): check valid warn message (sequelize#9919)
fix(query): check valid warn message (sequelize#9919)
fix(query): check valid warn message (#9919) (#9948)