diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-09-03 09:26:54 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-09-03 09:26:54 +0300 |
commit | c3752cef3c34589ea95a7ab66cff3dd5b11290d5 (patch) | |
tree | c7b8eb21dedd3139dacf2c0a12bed6e362afa1d9 /storage/innobase/include/row0mysql.h | |
parent | 56ae0adee35c1bc053711a8579857e6b0301eb80 (diff) | |
parent | 2a93e632b1676b6df3dde150888d6428a57f8399 (diff) | |
download | mariadb-git-c3752cef3c34589ea95a7ab66cff3dd5b11290d5.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'storage/innobase/include/row0mysql.h')
-rw-r--r-- | storage/innobase/include/row0mysql.h | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index 8c9b5325c5f..d32b84198e0 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/innobase/include/row0mysql.h @@ -843,6 +843,8 @@ struct VCOL_STORAGE byte *innobase_record; byte *maria_record; String *blob_value_storage; + VCOL_STORAGE(): maria_table(NULL), innobase_record(NULL), + maria_record(NULL), blob_value_storage(NULL) {} }; /** @@ -865,12 +867,48 @@ bool innobase_allocate_row_for_vcol( dict_index_t* index, mem_heap_t** heap, TABLE** table, - byte** record, - VCOL_STORAGE** storage); + VCOL_STORAGE* storage); /** Free memory allocated by innobase_allocate_row_for_vcol() */ void innobase_free_row_for_vcol(VCOL_STORAGE *storage); +class ib_vcol_row +{ + VCOL_STORAGE storage; +public: + mem_heap_t *heap; + + ib_vcol_row(mem_heap_t *heap) : heap(heap) {} + + byte *record(THD *thd, dict_index_t *index, TABLE **table) + { + if (!storage.innobase_record) + { + bool ok = innobase_allocate_row_for_vcol(thd, index, &heap, table, + &storage); + if (!ok) + return NULL; + } + return storage.innobase_record; + }; + + ~ib_vcol_row() + { + if (heap) + { + if (storage.innobase_record) + innobase_free_row_for_vcol(&storage); + mem_heap_free(heap); + } + } +}; + +/** Report virtual value computation failure in ib::error +@param[in] row the data row +*/ +ATTRIBUTE_COLD +void innobase_report_computed_value_failed(dtuple_t *row); + /** Get the computed value by supplying the base column values. @param[in,out] row the data row @param[in] col virtual column |