diff options
| author | Andreas Fischer <bantu@phpbb.com> | 2011-06-12 19:24:00 +0200 |
|---|---|---|
| committer | Andreas Fischer <bantu@phpbb.com> | 2011-06-12 19:24:00 +0200 |
| commit | 4adfa4685096f05e989ba7168bfaa4146e0d7cb4 (patch) | |
| tree | 6214747ede2c140fe2df1612cd297f209ac4843e /phpBB/develop/create_schema_files.php | |
| parent | bf2125f0f7c2b3d2f270ae4f3117941dd108f35a (diff) | |
| parent | 4e0717b4d7da58469c795191236ad4256a20c72a (diff) | |
| download | forums-4adfa4685096f05e989ba7168bfaa4146e0d7cb4.tar forums-4adfa4685096f05e989ba7168bfaa4146e0d7cb4.tar.gz forums-4adfa4685096f05e989ba7168bfaa4146e0d7cb4.tar.bz2 forums-4adfa4685096f05e989ba7168bfaa4146e0d7cb4.tar.xz forums-4adfa4685096f05e989ba7168bfaa4146e0d7cb4.zip | |
Merge remote-tracking branch 'naderman/ticket/9892' into develop-olympus
* naderman/ticket/9892:
[ticket/9892] Correct copyright year
[ticket/9892] Remove incorrect use of camel case
[ticket/9892] Removing closing php tag from create_schema_files
[ticket/9892] Transaction support for database update sql execution function
[ticket/9892] count is a keyword in firebird, so renaming this alias
[ticket/9892] Q&A CAPTCHA did not work on firebird, so no need to change config
[ticket/9892] Shorten login_attempt key names to avoid firebird length problems
[ticket/9892] Drop Q&A CAPTCHA tables if left in inconsistent state
[ticket/9892] Adding a number of tests for db_tools
[ticket/9892] Table prefix lengths influence index lengths in db_tools
[ticket/9892] Shorten the index names on the q&a captcha
[ticket/9892] column & index name limits, firebird auto increment in db_tools
Diffstat (limited to 'phpBB/develop/create_schema_files.php')
| -rw-r--r-- | phpBB/develop/create_schema_files.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index f1e2858848..c153f3e1e8 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,3 @@ EOF; echo 'done'; -?>
\ No newline at end of file |
