| 9036 | } |
| 9037 | |
| 9038 | static Create_field *vers_init_sys_field(THD *thd, |
| 9039 | const Lex_ident_column &field_name, |
| 9040 | int flags, bool integer) |
| 9041 | { |
| 9042 | Create_field *f= new (thd->mem_root) Create_field(); |
| 9043 | if (!f) |
| 9044 | return NULL; |
| 9045 | |
| 9046 | f->field_name= field_name; |
| 9047 | f->charset= system_charset_info; |
| 9048 | f->flags= flags | NO_DEFAULT_VALUE_FLAG | NOT_NULL_FLAG; |
| 9049 | if (integer) |
| 9050 | { |
| 9051 | f->set_handler(&type_handler_vers_trx_id); |
| 9052 | f->length= MY_INT64_NUM_DECIMAL_DIGITS - 1; |
| 9053 | f->flags|= UNSIGNED_FLAG; |
| 9054 | } |
| 9055 | else |
| 9056 | { |
| 9057 | f->set_handler(&type_handler_timestamp2); |
| 9058 | f->length= MAX_DATETIME_FULL_WIDTH; |
| 9059 | f->decimals= MAX_DATETIME_PRECISION; |
| 9060 | f->flags|= UNSIGNED_FLAG; |
| 9061 | } |
| 9062 | f->invisible= DBUG_IF("sysvers_show") ? VISIBLE : INVISIBLE_SYSTEM; |
| 9063 | |
| 9064 | if (f->check(thd)) |
| 9065 | return NULL; |
| 9066 | |
| 9067 | return f; |
| 9068 | } |
| 9069 | |
| 9070 | bool Vers_parse_info::create_sys_field(THD *thd, |
| 9071 | const Lex_ident_column &field_name, |
no test coverage detected