Hi, Alexander! On Dec 23, Alexander Barkov wrote:
Hi Kristian, Sergei. What about this plan:
1. In 10.0:
a. Make "ALTER TABLE t1 FORCE" fully rebuild the table and change old DECIMAL to new DECIMAL.
What about DECIMAL(200,30)? What to convert this to? Perhaps that should always require an explicit manual ALTER TABLE t1 MODIFY f1 DECIMAL(N,M) ?
b. Keep "CHECK TABLE t1 FOR UPGRADE" to still return a line with Msg_type=status and Msg_text=OK, but also add new lines with Msg_type=note and Msg_text telling something like: "The table 'db.table' has deprecated columns types incompatible with Row-based replication." "REPAIR TABLE is recommended. Note, this can take some time.".
Why status OK? So that mysql_upgrade would not upgrade them automatically?
c. mysql_upgrade will NOT upgrade tables with the old DECIMAL automatically, because they will still be reported as "OK".
But mysql_upgrade should detects and prints the new notes in the "CHECK TABLE t1 FOR UPGRADE" output.
d. Make the master running with --binlog-format=row refuse to do any INSERT/UPDATE/ALTER or any other queries that can modify a table with the old DECIMAL.
Also, make "mysqld --binlog-format=row" disallow queries like: "CREATE TABLE t2 AS SELECT old_decimal FROM t1";
Make it print an error: "The table 'db.table' has deprecated columns types incompatible with Row-based replication."
(the same text with #b, but this time an error instead of a note).
Note, one will have to stop binary logging, upgrade the table, and restart mysqld with binary logging again.
I leave it to Kristian...
e. A SELECT from a table with the old DECIMAL should probably also print a warning, to give the user another chance to know about the problem.
Hmm, I'm not sure it's a good idea. SELECT is perfectly safe. And warnings should rather be used sparingly.
f. Make INFORMATION_SCHEMA.COLUMNS somehow print information about the deprecated data types (in DATA_TYPE or COLUMN_TYPE or COLUMN_COMMENT).
Not COLUMN_COMMENT or COLUMN_COMMENT. But DATA_TYPE or - better - EXTRA - that should be ok.
2. In 10.1 Change "b" to return Msg_type=error and Mst_text= "Table upgrade required. Please do "REPAIR TABLE `tablename`" or dump/reload to fix it!" This will also force mysql_upgrade to rebuild tables with the old DECIMAL automatically.
That's kind of ok, but again, how to auto-convert a DECIMAL(200,30) column? Regards, Sergei