Guest User

Untitled

a guest
Dec 18th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. diff --git a/sql/handler.cc b/sql/handler.cc
  2. index 9d19ede0a70..c8d06114847 100644
  3. --- a/sql/handler.cc
  4. +++ b/sql/handler.cc
  5. @@ -6843,10 +6843,23 @@ bool Vers_parse_info::fix_implicit(THD *thd, Alter_info *alter_info,
  6. return false;
  7. }
  8.  
  9. -bool Table_scope_and_contents_source_st::vers_native(THD *thd) const
  10. +bool Table_scope_and_contents_source_st::vers_native(THD *thd, TABLE *table) const
  11. {
  12. - if (ha_check_storage_engine_flag(db_type, HTON_NATIVE_SYS_VERSIONING))
  13. + if (table)
  14. + {
  15. + handlerton *hton1= db_type;
  16. + handlerton *hton2= table->file->partition_ht();
  17. + bool int1 = ha_check_storage_engine_flag(hton1, HTON_NATIVE_SYS_VERSIONING);
  18. + bool int2 = ha_check_storage_engine_flag(hton2, HTON_NATIVE_SYS_VERSIONING);
  19. + if (hton1 != hton2)
  20. + return int1 || int2;
  21. + if (int1 || int2)
  22. + return true;
  23. + }
  24. + else if (ha_check_storage_engine_flag(db_type, HTON_NATIVE_SYS_VERSIONING))
  25. + {
  26. return true;
  27. + }
  28.  
  29. #ifdef WITH_PARTITION_STORAGE_ENGINE
  30. partition_info *info= thd->work_part_info;
  31. @@ -7092,7 +7105,7 @@ bool Vers_parse_info::fix_alter_info(THD *thd, Alter_info *alter_info,
  32. TABLE *table)
  33. {
  34. TABLE_SHARE *share= table->s;
  35. - bool integer_fields= create_info->vers_native(thd);
  36. + bool integer_fields= create_info->vers_native(thd, table);
  37. const char *table_name= share->table_name.str;
  38.  
  39. if (!need_check() && !share->versioned)
  40. diff --git a/sql/handler.h b/sql/handler.h
  41. index 44e18e17a1e..58826446f04 100644
  42. --- a/sql/handler.h
  43. +++ b/sql/handler.h
  44. @@ -1878,7 +1878,7 @@ struct Table_scope_and_contents_source_st
  45. List<Item> *items= NULL,
  46. bool *versioned_write= NULL);
  47.  
  48. - bool vers_native(THD *thd) const;
  49. + bool vers_native(THD *thd, TABLE *table=NULL) const;
  50.  
  51. void init()
  52. {
Add Comment
Please, Sign In to add comment