diff options
-rw-r--r-- | src/Components/DataType.php | 2 | ||||
-rw-r--r-- | src/Lexer.php | 5 | ||||
-rw-r--r-- | tests/Builder/CreateStatementTest.php | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/Components/DataType.php b/src/Components/DataType.php index 76c9c29..99c3918 100644 --- a/src/Components/DataType.php +++ b/src/Components/DataType.php @@ -159,7 +159,7 @@ class DataType extends Component $tmp = '(' . implode(', ', $component->parameters) . ')'; } return trim( - $component->name . ' ' . $tmp . ' ' + $component->name . $tmp . ' ' . OptionsArray::build($component->options) ); } diff --git a/src/Lexer.php b/src/Lexer.php index a129dfa..719a955 100644 --- a/src/Lexer.php +++ b/src/Lexer.php @@ -34,6 +34,11 @@ namespace SqlParser { if (!defined('USE_UTF_STRINGS')) { + // NOTE: In previous versions of PHP (5.5 and older) the default + // internal encoding is "ISO-8859-1". + // All `mb_` functions must specify the correct encoding, which is + // 'UTF-8' in order to work properly. + /** * Forces usage of `UtfString` if the string is multibyte. * `UtfString` may be slower, but it gives better results. diff --git a/tests/Builder/CreateStatementTest.php b/tests/Builder/CreateStatementTest.php index 45afd00..6aa994b 100644 --- a/tests/Builder/CreateStatementTest.php +++ b/tests/Builder/CreateStatementTest.php @@ -58,7 +58,7 @@ class CreateStatementTest extends TestCase $this->assertEquals( "CREATE TABLE `test` (\n" . - "`id` INT (11) UNSIGNED NOT NULL AUTO_INCREMENT,\n" . + "`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,\n" . "PRIMARY KEY (`id`)\n" . ") ", $stmt->build() |