我将一个 >2KB 的 SQL 文件粘贴到 mysql CLI,它随机丢失字符,然后在我的 SQL 中报告语法错误。
例如:
(.....)
UPDATE ct_transform_target_summary
SET
ytd_margin_target = jul_margin_target + aug_margin_target + sep_margin_target + oct_margin_target + nov_margin_target + dec_margin_target +
jan_margin_target + feb_margin_target + mar_margin_target + apr_margin_target + may_margin_target + jun_margin_target,
ytd_adjustments = jul_margin_adj + aug_margin_adj + sep_margin_adj + oct_margin_adj + nov_margin_adj + dec_margin_adj +
jan_margin_adj + feb_margin_adj + mar_margin_adj + apt_margin_adj + may_margin_adj + jun_margin_adj,
ytd_margin = jul_margin + aug_margin + sep_margin + oct_margin + nov_margin + dec_margin +
jan_margin + feb_margin + mar_margin + apr_margin + may_margin + jun_margin;
(....)
变成:
(....)
->
->
-> SET
-> ytd_margin_target = jul_margin_target + aug_margin_target + sep_margin_target + oct_margin_target + nov_margin_target + dec_margin_target +
->
-> ytd_adjustments = jul_margin_adj + aug_margin_adj + sep_margin_adj + oct_margin_adj + nov_margin_adj + dec_margin_adj +
-> jan_margin_adj + feb_ma
-> ytd_margin = jul_margin + aug_margin + sep_margin + oct_margin + nov_margin + dec_margin +
-> jan_margin + feb_margin + mar_margin + apr_margin + may_
这显然不会发生在短 SQL 代码上,而只会发生在长代码上。这可能是由我的终端(Fedora 17 Gnome 终端)引起的,还是 mysql CLI 的问题?
我以前从未在终端遇到过这样的问题。它只发生在 mysql cli 中。