For decimal columns, the format of the type + modifier is decimal(x,y) where x is the length and y is the number of decimal places. The mysql_type column currently contains values like decimal(x,. This causes issues when trying to get a create statement:
CREATE TABLE wp_wc_order_operational_data (
`id` bigint(20) unsigned PRIMARY KEY AUTO_INCREMENT NOT NULL,
...
`date_completed_gmt` datetime DEFAULT NULL,
`shipping_tax_amount` decimal(26, DEFAULT NULL,
`shipping_total_amount` decimal(26, DEFAULT NULL,
`discount_tax_amount` decimal(26, DEFAULT NULL,
`discount_total_amount` decimal(26, DEFAULT NULL,
`recorded_sales` tinyint(1) DEFAULT NULL,
KEY wp_wc_order_operational_data__order_key (order_key),
UNIQUE KEY wp_wc_order_operational_data__order_id (order_id)
);
This can be fixed in the WP_SQLite_Translator::skip_mysql_data_type method. Here we consume exactly 3 tokens, which works only when there is a single value between the brackets (x). Instead, we should consume/skip tokens until we find the closing ) of the type modifier.
For decimal columns, the format of the type + modifier is
decimal(x,y)wherexis the length andyis the number of decimal places. Themysql_typecolumn currently contains values likedecimal(x,. This causes issues when trying to get a create statement:This can be fixed in the
WP_SQLite_Translator::skip_mysql_data_typemethod. Here we consume exactly 3 tokens, which works only when there is a single value between the brackets(x). Instead, we should consume/skip tokens until we find the closing)of the type modifier.