summaryrefslogtreecommitdiff
path: root/sql/sys_vars.ic
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2017-12-18 19:03:51 +0300
committerGitHub <noreply@github.com>2017-12-18 19:03:51 +0300
commitb55a149194e7f73b5ceb35a0a5d5fb575a8ba586 (patch)
tree5586c3cbb6189f5823bb71e983eb381f6769fda8 /sql/sys_vars.ic
parentd5e37621cf1dd2fe1a1226992be05ca57d595b79 (diff)
downloadmariadb-git-b55a149194e7f73b5ceb35a0a5d5fb575a8ba586.tar.gz
Timestamp-based versioning for InnoDB [closes #209]
* Removed integer_fields check * Reworked Vers_parse_info::check_sys_fields() * Misc renames * versioned as vers_sys_type_t * Removed versioned_by_sql(), versioned_by_engine() versioned() works as before; versioned(VERS_TIMESTAMP) is versioned_by_sql(); versioned(VERS_TRX_ID) is versioned_by_engine(). * create_tmp_table() fix * Foreign constraints for timestamp-based * Range auto-specifier fix * SQL: 1-row partition rotation fix [fixes #260] * Fix 'drop system versioning, algorithm=inplace'
Diffstat (limited to 'sql/sys_vars.ic')
-rw-r--r--sql/sys_vars.ic27
1 files changed, 14 insertions, 13 deletions
diff --git a/sql/sys_vars.ic b/sql/sys_vars.ic
index a2ea75d0dc2..200669a5bf5 100644
--- a/sql/sys_vars.ic
+++ b/sql/sys_vars.ic
@@ -2628,17 +2628,17 @@ public:
bool res= var->value->get_date(&ltime, 0);
if (!res)
{
- var->save_result.ulonglong_value= FOR_SYSTEM_TIME_AS_OF;
+ var->save_result.ulonglong_value= SYSTEM_TIME_AS_OF;
}
return res;
}
private:
- bool update(set_var *var, st_vers_asof_timestamp &out)
+ bool update(set_var *var, vers_asof_timestamp_t &out)
{
bool res= false;
out.type= static_cast<enum_var_type>(var->save_result.ulonglong_value);
- if (out.type == FOR_SYSTEM_TIME_AS_OF)
+ if (out.type == SYSTEM_TIME_AS_OF)
{
res= var->value->get_date(&out.ltime, 0);
}
@@ -2648,27 +2648,28 @@ private:
public:
virtual bool global_update(THD *thd, set_var *var)
{
- return update(var, global_var(st_vers_asof_timestamp));
+ return update(var, global_var(vers_asof_timestamp_t));
}
virtual bool session_update(THD *thd, set_var *var)
{
- return update(var, session_var(thd, st_vers_asof_timestamp));
+ return update(var, session_var(thd, vers_asof_timestamp_t));
}
private:
- uchar *value_ptr(THD *thd, st_vers_asof_timestamp &val)
+ uchar *value_ptr(THD *thd, vers_asof_timestamp_t &val)
{
switch (val.type)
{
- case FOR_SYSTEM_TIME_UNSPECIFIED:
- case FOR_SYSTEM_TIME_ALL:
+ case SYSTEM_TIME_UNSPECIFIED:
+ case SYSTEM_TIME_ALL:
return (uchar*) thd->strdup(asof_keywords[val.type]);
- case FOR_SYSTEM_TIME_AS_OF:
+ case SYSTEM_TIME_AS_OF:
{
uchar *buf= (uchar*) thd->alloc(MAX_DATE_STRING_REP_LENGTH);
if (buf &&!my_datetime_to_str(&val.ltime, (char*) buf, 6))
{
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "versioning_asof_timestamp", "NULL (wrong datetime)");
+ // TODO: figure out variable name
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "system_versioning_asof_timestamp", "NULL (wrong datetime)");
return (uchar*) thd->strdup("Error: wrong datetime");
}
return buf;
@@ -2676,13 +2677,13 @@ private:
default:
break;
}
- my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "versioning_asof_timestamp", "NULL (wrong range type)");
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "system_versioning_asof_timestamp", "NULL (wrong range type)");
return (uchar*) thd->strdup("Error: wrong range type");
}
public:
virtual uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base)
- { return value_ptr(thd, session_var(thd, st_vers_asof_timestamp)); }
+ { return value_ptr(thd, session_var(thd, vers_asof_timestamp_t)); }
virtual uchar *global_value_ptr(THD *thd, const LEX_CSTRING *base)
- { return value_ptr(thd, global_var(st_vers_asof_timestamp)); }
+ { return value_ptr(thd, global_var(vers_asof_timestamp_t)); }
};