summaryrefslogtreecommitdiff
path: root/innobase/dict
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2005-02-17 17:15:29 +0200
committerunknown <marko@hundin.mysql.fi>2005-02-17 17:15:29 +0200
commit6075463f0342c0bf178c40dd7f9ecdeb7d5c8235 (patch)
treec7f0fcd17c220dc071ec22c5ba7c04fc4544d346 /innobase/dict
parentca021698d1f41d63bacfb3baf5a73dc40790547c (diff)
downloadmariadb-git-6075463f0342c0bf178c40dd7f9ecdeb7d5c8235.tar.gz
InnoDB: Make CREATE TABLE return error when the minimum row length
exceeds the maximum record size. (Bug #5682) innobase/data/data0type.c: Remove function dtype_str_needs_mysql_cmp(). Document dtype_get_at_most_n_mbchars(). dtype_get_at_most_n_mbchars(): Use mbminlen and mbmaxlen. innobase/dict/dict0crea.c: dict_build_table_def_step(): Reject if minimum row size is too big. innobase/include/data0type.h: Remove dtype_str_needs_mysql_cmp(). Document dtype_get_at_most_n_mbchars(). Add dtype_get_min_size(). innobase/include/data0type.ic: Add dtype_get_min_size(). innobase/include/row0mysql.h: row_mysql_store_col_in_innobase_format(): Add parameter comp, as we will only truncate UTF-8 CHAR(n) columns in row_format=compact. innobase/include/row0mysql.ic: row_mysql_store_col_in_innobase_format(): Add parameter comp, as we will only truncate UTF-8 CHAR(n) columns in row_format=compact. innobase/row/row0mysql.c: Pass parameter comp to row_mysql_store_col_in_innobase_format(). innobase/row/row0sel.c: Pass parameter comp to row_mysql_store_col_in_innobase_format(). row_sel_field_store_in_mysql_format(): Undo the stripping of UTF-8 CHAR(n) columns by padding with spaces.
Diffstat (limited to 'innobase/dict')
-rw-r--r--innobase/dict/dict0crea.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/innobase/dict/dict0crea.c b/innobase/dict/dict0crea.c
index b6f79ad10b4..4926797721c 100644
--- a/innobase/dict/dict0crea.c
+++ b/innobase/dict/dict0crea.c
@@ -220,6 +220,8 @@ dict_build_table_def_step(
const char* path_or_name;
ibool is_path;
mtr_t mtr;
+ ulint i;
+ ulint row_len;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
@@ -231,6 +233,15 @@ dict_build_table_def_step(
thr_get_trx(thr)->table_id = table->id;
+ row_len = 0;
+ for (i = 0; i < table->n_def; i++) {
+ row_len += dtype_get_min_size(dict_col_get_type(
+ &table->cols[i]));
+ }
+ if (row_len > BTR_PAGE_MAX_REC_SIZE) {
+ return(DB_TOO_BIG_RECORD);
+ }
+
if (table->type == DICT_TABLE_CLUSTER_MEMBER) {
cluster_table = dict_table_get_low(table->cluster_name);