Commit a4439fef authored by Aleksey Midenkov's avatar Aleksey Midenkov

SQL: don't update TRT when altered [#305, #302]

Tests affected: main.mysqlcheck
parent ecf259ca
...@@ -31,6 +31,7 @@ mysql.time_zone_leap_second OK ...@@ -31,6 +31,7 @@ mysql.time_zone_leap_second OK
mysql.time_zone_name OK mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.transaction_registry OK
mysql.user OK mysql.user OK
mysql.vtmd_template OK mysql.vtmd_template OK
mtr.global_suppressions Table is already up to date mtr.global_suppressions Table is already up to date
...@@ -66,6 +67,9 @@ mysql.time_zone_leap_second OK ...@@ -66,6 +67,9 @@ mysql.time_zone_leap_second OK
mysql.time_zone_name OK mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.transaction_registry
note : Table does not support optimize, doing recreate + analyze instead
status : OK
mysql.user OK mysql.user OK
mysql.vtmd_template mysql.vtmd_template
note : Table does not support optimize, doing recreate + analyze instead note : Table does not support optimize, doing recreate + analyze instead
...@@ -97,6 +101,7 @@ mysql.time_zone_leap_second OK ...@@ -97,6 +101,7 @@ mysql.time_zone_leap_second OK
mysql.time_zone_name OK mysql.time_zone_name OK
mysql.time_zone_transition OK mysql.time_zone_transition OK
mysql.time_zone_transition_type OK mysql.time_zone_transition_type OK
mysql.transaction_registry OK
mysql.user OK mysql.user OK
mysql.vtmd_template OK mysql.vtmd_template OK
mysql.column_stats Table is already up to date mysql.column_stats Table is already up to date
...@@ -130,6 +135,9 @@ mysql.time_zone_leap_second Table is already up to date ...@@ -130,6 +135,9 @@ mysql.time_zone_leap_second Table is already up to date
mysql.time_zone_name Table is already up to date mysql.time_zone_name Table is already up to date
mysql.time_zone_transition Table is already up to date mysql.time_zone_transition Table is already up to date
mysql.time_zone_transition_type Table is already up to date mysql.time_zone_transition_type Table is already up to date
mysql.transaction_registry
note : Table does not support optimize, doing recreate + analyze instead
status : OK
mysql.user Table is already up to date mysql.user Table is already up to date
mysql.vtmd_template mysql.vtmd_template
note : Table does not support optimize, doing recreate + analyze instead note : Table does not support optimize, doing recreate + analyze instead
...@@ -455,6 +463,7 @@ mysql.time_zone_leap_second Table is already up to date ...@@ -455,6 +463,7 @@ mysql.time_zone_leap_second Table is already up to date
mysql.time_zone_name Table is already up to date mysql.time_zone_name Table is already up to date
mysql.time_zone_transition Table is already up to date mysql.time_zone_transition Table is already up to date
mysql.time_zone_transition_type Table is already up to date mysql.time_zone_transition_type Table is already up to date
mysql.transaction_registry OK
mysql.user Table is already up to date mysql.user Table is already up to date
mysql.vtmd_template OK mysql.vtmd_template OK
mysqltest1.t1 mysqltest1.t1
......
...@@ -7430,7 +7430,7 @@ static bool mysql_inplace_alter_table(THD *thd, ...@@ -7430,7 +7430,7 @@ static bool mysql_inplace_alter_table(THD *thd,
{ {
TR_table trt(thd, true); TR_table trt(thd, true);
if (table->file->native_versioned()) if (table->file->native_versioned() && trt != *table_list)
{ {
if (opt_transaction_registry && trt.update()) if (opt_transaction_registry && trt.update())
return true; return true;
......
...@@ -2961,6 +2961,15 @@ class TR_table: public TABLE_LIST ...@@ -2961,6 +2961,15 @@ class TR_table: public TABLE_LIST
ulonglong commit_id1= 0, enum_tx_isolation iso_level1= ISO_READ_UNCOMMITTED, ulonglong commit_id1= 0, enum_tx_isolation iso_level1= ISO_READ_UNCOMMITTED,
ulonglong commit_id0= 0); ulonglong commit_id0= 0);
enum_tx_isolation iso_level() const;
void store_iso_level(enum_tx_isolation iso_level)
{
DBUG_ASSERT(iso_level <= ISO_SERIALIZABLE);
store(FLD_ISO_LEVEL, iso_level + 1);
}
bool check();
public:
TABLE * operator-> () const TABLE * operator-> () const
{ {
return table; return table;
...@@ -2974,13 +2983,16 @@ class TR_table: public TABLE_LIST ...@@ -2974,13 +2983,16 @@ class TR_table: public TABLE_LIST
{ {
return table; return table;
} }
enum_tx_isolation iso_level() const; bool operator== (TABLE_LIST &subj) const
void store_iso_level(enum_tx_isolation iso_level)
{ {
DBUG_ASSERT(iso_level <= ISO_SERIALIZABLE); if (0 != strcmp(db, subj.db))
store(FLD_ISO_LEVEL, iso_level + 1); return false;
return (0 == strcmp(table_name, subj.table_name));
}
bool operator!= (TABLE_LIST &subj) const
{
return !(*this == subj);
} }
bool check();
}; };
#endif /* MYSQL_CLIENT */ #endif /* MYSQL_CLIENT */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment