summaryrefslogtreecommitdiff
path: root/innobase/row
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2004-10-05 17:08:22 +0300
committerunknown <heikki@hundin.mysql.fi>2004-10-05 17:08:22 +0300
commit0b8c68ce5c6f740740953757b192078b03bd5bb6 (patch)
tree034b6740cd2bcca301b0ebb50ddca2b3ae98f81b /innobase/row
parentfdbc804c3295fb4ba46e07b89554bb924cbd7d92 (diff)
downloadmariadb-git-0b8c68ce5c6f740740953757b192078b03bd5bb6.tar.gz
ha_innodb.cc:
Raise maximum column prefix len to 767 bytes, so that MySQL can create a column prefix index of 255 UTF-8 characters (each takes 3 bytes at the maximum); add comments about why innobase_get_at_most_n_mbchars() works ok dict0mem.h: Raise maximum column prefix len to 767 bytes, so that MySQL can create a column prefix index of 255 UTF-8 characters (each takes 3 bytes at the maximum) row0mysql.c: If MySQL tries to create a column prefix index longer that 255 UTF-8 characters, give an error, and drop the table from the InnoDB internal data dictionary. MySQL did not drop the table there in its own error handling. innobase/row/row0mysql.c: If MySQL tries to create a column prefix index longer that 255 UTF-8 characters, give an error, and drop the table from the InnoDB internal data dictionary. MySQL did not drop the table there in its own error handling. innobase/include/dict0mem.h: Raise maximum column prefix len to 767 bytes, so that MySQL can create a column prefix index of 255 UTF-8 characters (each takes 3 bytes at the maximum) sql/ha_innodb.cc: Raise maximum column prefix len to 767 bytes, so that MySQL can create a column prefix index of 255 UTF-8 characters (each takes 3 bytes at the maximum); add comments about why innobase_get_at_most_n_mbchars() works ok
Diffstat (limited to 'innobase/row')
-rw-r--r--innobase/row/row0mysql.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index c796646fc37..152bb0291c3 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -1630,6 +1630,8 @@ row_create_index_for_mysql(
trx->op_info = "creating index";
+ trx_start_if_not_started(trx);
+
/* Check that the same column does not appear twice in the index.
Starting from 4.0.14, InnoDB should be able to cope with that, but
safer not to allow them. */
@@ -1656,9 +1658,16 @@ row_create_index_for_mysql(
goto error_handling;
}
}
- }
+
+ /* Check also that prefix_len < DICT_MAX_COL_PREFIX_LEN */
- trx_start_if_not_started(trx);
+ if (dict_index_get_nth_field(index, i)->prefix_len
+ >= DICT_MAX_COL_PREFIX_LEN) {
+ err = DB_TOO_BIG_RECORD;
+
+ goto error_handling;
+ }
+ }
if (row_mysql_is_recovered_tmp_table(index->table_name)) {