summaryrefslogtreecommitdiff
path: root/storage/innobase/include/row0mysql.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-09-03 15:53:38 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-09-03 15:53:38 +0300
commitc9cf6b13f6f9aaae57efb514e0b0f51e7ea09798 (patch)
tree810d8e37f7b3dded1323a79ce43f14603679c0a7 /storage/innobase/include/row0mysql.h
parentb795adcff72a84421576748646e2446e3ef24202 (diff)
parent33ae1616e01b564d03c507769564d37c582783cf (diff)
downloadmariadb-git-c9cf6b13f6f9aaae57efb514e0b0f51e7ea09798.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'storage/innobase/include/row0mysql.h')
-rw-r--r--storage/innobase/include/row0mysql.h42
1 files changed, 40 insertions, 2 deletions
diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h
index e5798f1f673..f018f4eed73 100644
--- a/storage/innobase/include/row0mysql.h
+++ b/storage/innobase/include/row0mysql.h
@@ -848,6 +848,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) {}
};
/**
@@ -870,12 +872,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