[ISSUE-17793] UUID - Fix insert error
Signed-off-by: Mo Sureerat <sureemo@gmail.com>
This commit is contained in:
parent
ddf928e6f3
commit
15e629c9c1
@ -1746,7 +1746,7 @@ class InsertEdit
|
||||
if (
|
||||
$editField->type === 'uuid'
|
||||
&& ! $editField->isNull
|
||||
&& in_array($editField->value, ["''", '', "'uuid()'"], true)
|
||||
&& in_array($editField->value, ["''", '', "'uuid()'", 'uuid()'], true)
|
||||
) {
|
||||
return 'uuid()';
|
||||
}
|
||||
|
||||
@ -2768,6 +2768,24 @@ class InsertEditTest extends AbstractTestCase
|
||||
|
||||
$this->assertEquals('`fld` = uuid()', $result);
|
||||
|
||||
// Test that the uuid function as a value uses the uuid function to generate a value
|
||||
$result = $this->insertEdit->getQueryValueForUpdate(
|
||||
new EditField(
|
||||
'fld',
|
||||
"uuid()",
|
||||
'uuid',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
null,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
$this->assertEquals('`fld` = uuid()', $result);
|
||||
|
||||
// Test that the uuid type does not have a default value other than null when it is nullable
|
||||
$result = $this->insertEdit->getQueryValueForUpdate(
|
||||
new EditField(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user