`lower_case_table_names=1` causes error
c0494133d4 opened this issue · 3 comments
c0494133d4 commented
-- 修改my.cnf: lower_case_table_names=1
select @@lower_case_table_names;
create schema if not exists a1036;
use a1036;
drop table if exists AAA;
create table AAA (id int primary key auto_increment);
alter table AAA add column val int;
-- alter table 复制报错: table does not exist in sqle.context
现状
- 当lower_case_table_names=1时, dtle通过修改ast并重写sql (使用tidb parser), 使库表名小
写化, 然后送至sqleContext计算表结构.
问题
- sqleContext处理alter table时, 引用了原表(未经小写化)的语句, 而非仅使用ast
修复
- 重写sql后, 重新生成ast
ffffwh commented
Case 2: LowerString(&TableSchemaRegex)
错误
例如\W
->\w
肯定不对.
ffffwh commented
Case 3: review the usage of the variable query8
in binlog_reader.go
asiroliu commented
新增自动化测试用例