summaryrefslogtreecommitdiff
path: root/sql/item_create.cc
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2012-09-28 14:01:17 +0300
committerunknown <sanja@montyprogram.com>2012-09-28 14:01:17 +0300
commit7327cd9717f0b98499f0f5b19c84e5e3e48241df (patch)
treef652710ef9b4e4f9709728f1bca3b01ee52fdfc9 /sql/item_create.cc
parent4db207d56da2f832d8bc6cc1d935a17efcbc1035 (diff)
downloadmariadb-git-7327cd9717f0b98499f0f5b19c84e5e3e48241df.tar.gz
MDEV-377 Name support for dynamic columns
MDEV-127 Optimization of memory allocation MDEV-483 Make column_check function which cheсks dynamic columns integrit JSON conversion function
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r--sql/item_create.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 96837a8f262..f886b3d598b 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -5704,7 +5704,7 @@ static List<Item> *create_func_dyncol_prepare(THD *thd,
for (uint i= 0; (def= li++) ;)
{
dfs[0][i++]= *def;
- args->push_back(def->num);
+ args->push_back(def->key);
args->push_back(def->value);
}
return args;
@@ -5720,6 +5720,10 @@ Item *create_func_dyncol_create(THD *thd, List<DYNCALL_CREATE_DEF> &list)
return new (thd->mem_root) Item_func_dyncol_create(*args, dfs);
}
+Item *create_func_dyncol_json(THD *thd, Item *str)
+{
+ return new (thd->mem_root) Item_func_dyncol_json(str);
+}
Item *create_func_dyncol_add(THD *thd, Item *str,
List<DYNCALL_CREATE_DEF> &list)
@@ -5740,7 +5744,7 @@ Item *create_func_dyncol_add(THD *thd, Item *str,
Item *create_func_dyncol_delete(THD *thd, Item *str, List<Item> &nums)
{
DYNCALL_CREATE_DEF *dfs;
- Item *num;
+ Item *key;
List_iterator_fast<Item> it(nums);
List<Item> *args= new (thd->mem_root) List<Item>;
@@ -5750,12 +5754,12 @@ Item *create_func_dyncol_delete(THD *thd, Item *str, List<Item> &nums)
if (!args || !dfs)
return NULL;
- for (uint i= 0; (num= it++); i++)
+ for (uint i= 0; (key= it++); i++)
{
- dfs[i].num= num;
+ dfs[i].key= key;
dfs[i].value= new Item_null();
dfs[i].type= DYN_COL_INT;
- args->push_back(dfs[i].num);
+ args->push_back(dfs[i].key);
args->push_back(dfs[i].value);
}