Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 968294b

Browse files
committed
Arguments with default values must be at the end of the argument list - more instances
1 parent fa9f372 commit 968294b

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

libraries/Table.class.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ static public function sGetStatusInfo($db, $table, $info = null, $force_read = f
365365
*
366366
* @param string $name name
367367
* @param string $type type ('INT', 'VARCHAR', 'BIT', ...)
368+
* @param string $index
368369
* @param string $length length ('2', '5,2', '', ...)
369370
* @param string $attribute attribute
370371
* @param string $collation collation
@@ -376,7 +377,6 @@ static public function sGetStatusInfo($db, $table, $info = null, $force_read = f
376377
* @param string $extra 'AUTO_INCREMENT'
377378
* @param string $comment field comment
378379
* @param array &$field_primary list of fields for PRIMARY KEY
379-
* @param string $index
380380
* @param mixed $default_orig
381381
* @param string $move_to new position for column
382382
*
@@ -386,10 +386,10 @@ static public function sGetStatusInfo($db, $table, $info = null, $force_read = f
386386
*
387387
* @return string field specification
388388
*/
389-
static function generateFieldSpec($name, $type, $length = '', $attribute = '',
389+
static function generateFieldSpec($name, $type, $index, $length = '', $attribute = '',
390390
$collation = '', $null = false, $default_type = 'USER_DEFINED',
391391
$default_value = '', $extra = '', $comment = '',
392-
&$field_primary = null, $index, $default_orig, $move_to
392+
&$field_primary = null, $default_orig = '', $move_to = ''
393393
) {
394394
$is_timestamp = strpos(strtoupper($type), 'TIMESTAMP') !== false;
395395

@@ -616,9 +616,9 @@ static public function generateAlter($oldcol, $newcol, $type, $length,
616616
) {
617617
return PMA_backquote($oldcol) . ' '
618618
. PMA_Table::generateFieldSpec(
619-
$newcol, $type, $length, $attribute,
619+
$newcol, $type, $index, $length, $attribute,
620620
$collation, $null, $default_type, $default_value, $extra,
621-
$comment, $field_primary, $index, $default_orig, $move_to
621+
$comment, $field_primary, $default_orig, $move_to
622622
);
623623
} // end function
624624

tbl_addfield.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
$definition = ' ADD ' . PMA_Table::generateFieldSpec(
8282
$_REQUEST['field_name'][$i],
8383
$_REQUEST['field_type'][$i],
84+
$i,
8485
$_REQUEST['field_length'][$i],
8586
$_REQUEST['field_attribute'][$i],
8687
isset($_REQUEST['field_collation'][$i])
@@ -98,7 +99,6 @@
9899
? $_REQUEST['field_comments'][$i]
99100
: '',
100101
$field_primary,
101-
$i
102102
);
103103

104104
if ($_REQUEST['field_where'] != 'last') {

tbl_create.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
$query = PMA_Table::generateFieldSpec(
9292
$_REQUEST['field_name'][$i],
9393
$_REQUEST['field_type'][$i],
94+
$i,
9495
$_REQUEST['field_length'][$i],
9596
$_REQUEST['field_attribute'][$i],
9697
isset($_REQUEST['field_collation'][$i])
@@ -108,7 +109,6 @@
108109
? $_REQUEST['field_comments'][$i]
109110
: '',
110111
$field_primary,
111-
$i,
112112
'',
113113
''
114114
);

0 commit comments

Comments
 (0)