怎么查看慢日志完整sql

请问:INFORMATION_SCHEMA.SLOW_QUERY。慢日志里的query语句太长,有什么办法看到完整sql的吗

1赞

这个问题貌似重复提了。

在即将发布的 2.1.16 中 query 字段从 varchar(4096) 修改成了 longblob,应该能够看到完整 SQL 了

你说的没错,我也去查看了表结构,我现在使用的是 TiDB 3.0.2版本

实际情况我的sql确实只有一半

"SELECT\n\tDcOrganizationMaster.paas_id AS paasId,\n\tDcOrganizationMaster.paas_is_del AS paasIsDel,\n\tDcOrganizationMaster.paas_create_user AS paasCreateUser,\n\tDcOrganizationMaster.paas_create_time AS paasCreateTime,\n\tDcOrganizationMaster.paas_update_user AS paasUpdateUser,\n\tDcOrganizationMaster.paas_update_time AS paasUpdateTime,\n\tDcOrganizationMaster.paas_version_no AS paasVersionNo,\n\tDcOrganizationMaster.paas_is_disable AS paasIsDisable,\n\tDcOrganizationMaster.address AS address,\n\tDcOrganizationMaster.organ_code AS organCode,\n\tDcOrganizationMaster.organ_name AS organName,\n\tDcOrganizationMaster.property_one AS propertyOne,\n\tDcOrganizationMaster.merge_to AS mergeTo,\n\tDcOrganizationMaster.parent_id AS parentId,\n\tDcOrganizationMaster.organ_type AS organType,\n\tDcOrganizationMaster.LEVEL AS LEVEL,\n\tDcOrganizationMaster.nature AS nature,\n\tDcOrganizationMaster.organ_used_names AS organUsedNames,\n\tDcOrganizationMaster.drugstore_type AS drugstoreType,\n\tDcOrganizationMaster.is_territory AS isTerritory,\n\tDcOrganizationMaster.su AS su,\n\tDcOrganizationMaster.bai AS bai,\n\tDcOrganizationMaster.erp_code_one AS erpCodeOne,\n\tdistrict.name_cn AS district,\n\t( SELECT city.name_cn FROM dc_geography city WHERE city.province_code = district.province_code AND city.geography_type = '3' ) AS city,\n\t(\nCASE\n\t\n\tWHEN ( SELECT province.name_cn FROM dc_geography province WHERE province.province_code = district.province_code AND province.geography_type = '7' ) IS NOT NULL THEN\n\t( SELECT province.name_cn FROM dc_geography province WHERE province.province_code = district.province_code AND province.geography_type = '7' ) /*非直辖市*/\n\t\n\tWHEN ( SELECT province.name_cn FROM dc_geography province WHERE province.province_code = district.province_code AND province.geography_type = '9' ) IS NOT NULL THEN\n\t( SELECT province.name_cn FROM dc_geography province WHERE province.province_code = district.province_code AND province.geography_type = '9' ) /*直辖市*/\nELSE NULL \nEND \n\t) AS province \nFROM\n\tdc_organization_master DcOrganizationMaster\n\tLEFT JOIN dc_geography distr"(len:2133);

没找到答案啊,麻烦给个连接,谢谢你

在 tidb.yml 中有一个配置项可以调整这个 log

非常感谢

如果别人的回答有帮助,可以标记为解决方案:white_check_mark:,这样其他有同样问题的人也可以快速找到答案~

嗯,好的。多谢提醒

1赞