summaryrefslogtreecommitdiff
path: root/sql/set_var.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/set_var.h')
-rw-r--r--sql/set_var.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/sql/set_var.h b/sql/set_var.h
index 7b2f9d5cb80..51f59981e14 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -406,20 +406,36 @@ public:
};
-class sys_var_client_collation :public sys_var_thd
+class sys_var_collation :public sys_var_thd
{
public:
- sys_var_client_collation(const char *name_arg) :sys_var_thd(name_arg)
- {}
+ sys_var_collation(const char *name_arg) :sys_var_thd(name_arg) {}
bool check(THD *thd, set_var *var);
- bool update(THD *thd, set_var *var);
- SHOW_TYPE type() { return SHOW_CHAR; }
- byte *value_ptr(THD *thd, enum_var_type type);
+SHOW_TYPE type() { return SHOW_CHAR; }
bool check_update_type(Item_result type)
{
return type != STRING_RESULT; /* Only accept strings */
}
bool check_default(enum_var_type type) { return 0; }
+ virtual void set_default(THD *thd, enum_var_type type)= 0;
+};
+
+class sys_var_client_collation :public sys_var_collation
+{
+public:
+ sys_var_client_collation(const char *name_arg) :sys_var_collation(name_arg) {}
+ bool update(THD *thd, set_var *var);
+ void set_default(THD *thd, enum_var_type type);
+ byte *value_ptr(THD *thd, enum_var_type type);
+};
+
+class sys_var_literal_collation :public sys_var_collation
+{
+public:
+ sys_var_literal_collation(const char *name_arg) :sys_var_collation(name_arg) {}
+ bool update(THD *thd, set_var *var);
+ void set_default(THD *thd, enum_var_type type);
+ byte *value_ptr(THD *thd, enum_var_type type);
};