Pull-request: #17860 Fixes: #17793 Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
commit
c00a904827
@ -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