Skip to content

Commit ffe2c09

Browse files
committed
SqlBuilder::tryDelimite() ignores casting ::int
1 parent 5d07f7d commit ffe2c09

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Database/Table/SqlBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ protected function buildQueryEnd(): string
752752

753753
protected function tryDelimite(string $s): string
754754
{
755-
return preg_replace_callback('#(?<=[^\w`"\[?]|^)[a-z_][a-z0-9_]*(?=[^\w`"(\]]|\z)#i', function ($m) {
755+
return preg_replace_callback('#(?<=[^\w`"\[?:]|^)[a-z_][a-z0-9_]*(?=[^\w`"(\]]|\z)#i', function ($m) {
756756
return strtoupper($m[0]) === $m[0] ? $m[0] : $this->driver->delimite($m[0]);
757757
}, $s);
758758
}

tests/Database/Table/SqlBuilder.tryDelimite().phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ Assert::same(reformat('[hello] [world]'), $tryDelimite->invoke($sqlBuilder, 'hel
2525
Assert::same(reformat('HELLO([world])'), $tryDelimite->invoke($sqlBuilder, 'HELLO(world)'));
2626
Assert::same(reformat('hello([world])'), $tryDelimite->invoke($sqlBuilder, 'hello(world)'));
2727
Assert::same('[hello]', $tryDelimite->invoke($sqlBuilder, '[hello]'));
28+
Assert::same(reformat('::int'), $tryDelimite->invoke($sqlBuilder, '::int'));

0 commit comments

Comments
 (0)