You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When comparing schemas with generated columns, the comparison has an error if a field is specified using backticks or if the expression includes artithmetic operators like addition, division etc. This is similar to #153 but it only dealt with simple string values in the generated column expression.
Input SQL
CREATE TABLE test_generated ( id int(11) NOT NULL AUTO_INCREMENT, log_ins int(11) NOT NULL DEFAULT '0', user_count int(11) NOT NULL DEFAULT '0', log_ins_per_user float GENERATED ALWAYS AS (log_ins / user_count) VIRTUAL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Current output
found syntax error when parsing DDL "CREATE TABLE test_generated ( id int(11) NOT NULL AUTO_INCREMENT, log_ins int(11) NOT NULL DEFAULT '0', user_count int(11) NOT NULL DEFAULT '0', log_ins_per_user float GENERATED ALWAYS AS (log_ins / user_count) VIRTUAL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8": syntax error at position 217 near 'log_ins'
Expected output
Any valid expression should be allowed, including fields specified with backticks, operators like +, -, *, /, (, ), <, >, =, >=, <= and common SQL functions like CONCAT() etc.
The text was updated successfully, but these errors were encountered:
When comparing schemas with generated columns, the comparison has an error if a field is specified using backticks or if the expression includes artithmetic operators like addition, division etc. This is similar to #153 but it only dealt with simple string values in the generated column expression.
Input SQL
CREATE TABLE
test_generated
(id
int(11) NOT NULL AUTO_INCREMENT,log_ins
int(11) NOT NULL DEFAULT '0',user_count
int(11) NOT NULL DEFAULT '0',log_ins_per_user
float GENERATED ALWAYS AS (log_ins
/user_count
) VIRTUAL,PRIMARY KEY (
id
)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Current output
found syntax error when parsing DDL "CREATE TABLE
test_generated
(id
int(11) NOT NULL AUTO_INCREMENT,log_ins
int(11) NOT NULL DEFAULT '0',user_count
int(11) NOT NULL DEFAULT '0',log_ins_per_user
float GENERATED ALWAYS AS (log_ins
/user_count
) VIRTUAL,PRIMARY KEY (
id
)) ENGINE=InnoDB DEFAULT CHARSET=utf8": syntax error at position 217 near 'log_ins'
Expected output
Any valid expression should be allowed, including fields specified with backticks, operators like +, -, *, /, (, ), <, >, =, >=, <= and common SQL functions like CONCAT() etc.
The text was updated successfully, but these errors were encountered: