oceanbase/sql-lifecycle-management

[Bug]: Stitching sql error

Ifffff opened this issue · 0 comments

Ifffff commented
(SELECT CAST(CONCAT('{"columns": [',IFNULL(@cols,''),'], "indexes": [',IFNULL(@indexes,''),'], "tables":[',IFNULL(@tbls,''),'],
    "version": "', VERSION(), '"}') AS CHAR) as metadata_json FROM
    (SELECT (@cols:=NULL), (SELECT (0) FROM information_schema.columns cols
    WHERE table_schema = 'mes_cert' AND table_name in ('exhaust_upload_history,cert_print_history')
    AND (0x00) IN (@cols:=CONCAT_WS(',', @cols, CONCAT('{"schema":"',cols.table_schema,'","table":"',cols.table_name,'",
    "name":"', replace(cols.column_name,'"', '\"'), '","type":"', cols.column_type, '","nullable":',
    IF(cols.IS_NULLABLE = 'YES', 'true', 'false'),  '}')))) ) cols,
    (SELECT (@indexes:=NULL), (SELECT (0) FROM information_schema.statistics indexes
    WHERE table_schema = 'mes_cert' AND table_name in ('exhaust_upload_history,cert_print_history')
    AND (0x00) IN (@indexes:=CONCAT_WS(',', @indexes, CONCAT('{"schema":"',indexes.table_schema,'","table":"',indexes.table_name,'",
    "name":"', indexes.index_name, '","column":"', indexes.column_name, '",
    "cardinality":', indexes.cardinality, ',"unique":', IF(indexes.non_unique = 1, 'false', 'true'), '}')))) ) indexes,
    (SELECT (@tbls:=NULL), (SELECT (0) FROM information_schema.tables tbls
    WHERE table_schema = 'mes_cert' AND table_name in ('exhaust_upload_history,cert_print_history') AND (0x00) IN
    (@tbls:=CONCAT_WS(',', @tbls, CONCAT('{', '"schema":"', `TABLE_SCHEMA`, '",', '"table":"', `TABLE_NAME`, '",', '"rows":',
    IFNULL(`TABLE_ROWS`, 0), ',', '"engine":"', IFNULL(`ENGINE`, ''), '"}')))) tbls) x);

front end stitching error