patch #2750541 [parser] Incorrect parsing of constraints in ALTER TABLE
This commit is contained in:
@@ -53,6 +53,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
|
||||
thanks to Haeber
|
||||
- bug #2650776 [import] SQL_MODE not saved during Partial Import
|
||||
- patch #1863739 [auth] cache control missing (PHP-CGI), thanks to stmfd
|
||||
- patch #2750541 [parser] Incorrect parsing of constraints in ALTER TABLE,
|
||||
thanks to Yannick Betemps - arkhee
|
||||
|
||||
3.1.5.0 (not yet released)
|
||||
|
||||
|
@@ -1742,6 +1742,7 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
$foreign_key_number = -1;
|
||||
$seen_create_table = FALSE;
|
||||
$seen_create = FALSE;
|
||||
$seen_alter = FALSE;
|
||||
$in_create_table_fields = FALSE;
|
||||
$brackets_level = 0;
|
||||
$in_timestamp_options = FALSE;
|
||||
@@ -1762,6 +1763,10 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
$seen_create = TRUE;
|
||||
}
|
||||
|
||||
if ($upper_data == 'ALTER') {
|
||||
$seen_alter = TRUE;
|
||||
}
|
||||
|
||||
if ($upper_data == 'TABLE' && $seen_create) {
|
||||
$seen_create_table = TRUE;
|
||||
$create_table_fields = array();
|
||||
@@ -1923,11 +1928,13 @@ if (! defined('PMA_MINIMUM_COMMON')) {
|
||||
}
|
||||
|
||||
if ($seen_references) {
|
||||
if ($seen_alter && $brackets_level > 0) {
|
||||
$foreign[$foreign_key_number]['ref_index_list'][] = $identifier;
|
||||
// here, the first bracket level corresponds to the
|
||||
// bracket of CREATE TABLE
|
||||
// so if we are on level 2, it must be the index list
|
||||
// of the foreign key REFERENCES
|
||||
if ($brackets_level > 1) {
|
||||
} elseif ($brackets_level > 1) {
|
||||
$foreign[$foreign_key_number]['ref_index_list'][] = $identifier;
|
||||
} elseif ($arr[$i+1]['type'] == 'punct_qualifier') {
|
||||
// identifier is `db`.`table`
|
||||
|
Reference in New Issue
Block a user