Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

非常偶然的情况下,日志不能正常记录explain的输出 #32

Open
zhaotian2470 opened this issue Sep 29, 2018 · 0 comments
Open

Comments

@zhaotian2470
Copy link

非常偶然的情况下,我看到日志只输出explain的3个字段,并且前面有一条错误日志,具体如下:
2018-09-29 09:46:15.397286 I | reflect err sql: Scan error on column index 6: converting driver.Value type []uint8 ("8,98") to a int64: invalid syntax
2018/09/29 09:46:15 [3] - - [SQL] [slow] duration: 34.608907ms, sql: select c.* from core_info as c where c.is_deleted = 0 and c.api_uuid='license' and c.person_check_id='3832568' and c.data_requested_at > '2017-09-29 09:46:15 +0800 CST' order by c.core_info_id desc limit 1[], explain: [{"table":"c","type":"index_merge","key":"idx_person_check_id,idx_api_uuid"}]

正常的日志的explain应该有7个字段,具体如下:
018/09/29 12:44:44 [2] - - 开始获取本地数据
2018/09/29 12:44:44 [3] - - [SQL] [slow] duration: 13.821561ms, sql: select c.* from core_info as c where c.is_deleted = 0 and c.api_uuid='license' and c.person_check_id='4358419' and c.data_requested_at > '2017-09-29 12:44:44 +0800 CST' order by c.core_info_id desc limit 1[], explain: [{"table":"c","type":"ref","key":"idx_person_check_id","key_len":8,"ref":"const","rows":8,"extra":"Using where"}]

我分析这些日志是在解析explain的时候打出来的,但是不能测试环境中复现出现象

我使用的环境:
go版本:go1.10.3
go-orm id:8f43191b5d0221c2d728c7fad0da61227254e6a5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant