diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-04-10 11:33:47 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-05-17 15:13:47 +0200 |
commit | e17e7985999b10c602ba72258e9a4b6e5fb91ed5 (patch) | |
tree | 041a34266d19c2e414bffafd26f2cfd007a7b8c4 /sql/item_strfunc.cc | |
parent | c368878fac7de6cb65790249990d28dcbf0ea255 (diff) | |
download | mariadb-git-e17e7985999b10c602ba72258e9a4b6e5fb91ed5.tar.gz |
cleanup: simplify multi-update's juggling with positions
introduce Item_temptable_rowid() that is used to store
table->file->position() in the temporary table record
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 8df4e72462d..d5911e01cef 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -5204,3 +5204,23 @@ null: my_free(names); return NULL; } + +Item_temptable_rowid::Item_temptable_rowid(TABLE *table_arg) + : Item_str_func(table_arg->in_use), table(table_arg) +{ + max_length= table->file->ref_length; +} + +void Item_temptable_rowid::fix_length_and_dec() +{ + used_tables_cache= table->map; + const_item_cache= false; +} + +String *Item_temptable_rowid::val_str(String *str) +{ + if (!((null_value= table->null_row))) + table->file->position(table->record[0]); + str_value.set((char*)(table->file->ref), max_length, &my_charset_bin); + return &str_value; +} |