aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/develop
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2011-06-12 01:21:55 +0200
committerNils Adermann <naderman@naderman.de>2011-06-12 01:28:01 +0200
commit418c3d546a5ea29b5ce338e4710e0d3636009733 (patch)
treef6698e84ec7d42e416ec1451172179ed4cb077e1 /phpBB/develop
parentbf2125f0f7c2b3d2f270ae4f3117941dd108f35a (diff)
downloadforums-418c3d546a5ea29b5ce338e4710e0d3636009733.tar
forums-418c3d546a5ea29b5ce338e4710e0d3636009733.tar.gz
forums-418c3d546a5ea29b5ce338e4710e0d3636009733.tar.bz2
forums-418c3d546a5ea29b5ce338e4710e0d3636009733.tar.xz
forums-418c3d546a5ea29b5ce338e4710e0d3636009733.zip
[ticket/9892] column & index name limits, firebird auto increment in db_tools
- Column names are limited to 30 characters - Index names are limited to 31 characters. On some dbms the index name contains both table name and actual index name so the limit applies to the sum of the lenghts of table name and index name. - Auto incremented column names are limited to 26 characters to provide an additional 4 characters for sequence names The code for firebird auto increment support using generators/sequences with triggers was copied from create_schema_files.php PHPBB3-9892
Diffstat (limited to 'phpBB/develop')
-rw-r--r--phpBB/develop/create_schema_files.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index f1e2858848..e59552f370 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -329,6 +329,15 @@ foreach ($supported_dbms as $dbms)
// Write columns one by one...
foreach ($table_data['COLUMNS'] as $column_name => $column_data)
{
+ if (strlen($column_name) > 30)
+ {
+ trigger_error("Column name '$column_name' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR);
+ }
+ if (isset($column_data[2]) && $column_data[2] == 'auto_increment' && strlen($column_name) > 26) // "${column_name}_gen"
+ {
+ trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR);
+ }
+
// Get type
if (strpos($column_data[0], ':') !== false)
{
@@ -632,6 +641,11 @@ foreach ($supported_dbms as $dbms)
$key_data[1] = array($key_data[1]);
}
+ if (strlen($table_name . $key_name) > 30)
+ {
+ trigger_error("Index name '$key_name' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR);
+ }
+
switch ($dbms)
{
case 'mysql_40':
@@ -2067,4 +2081,4 @@ EOF;
echo 'done';
-?> \ No newline at end of file
+?>