diff --git a/libraries/classes/InsertEdit.php b/libraries/classes/InsertEdit.php
index 161e41a051..d241723c7d 100644
--- a/libraries/classes/InsertEdit.php
+++ b/libraries/classes/InsertEdit.php
@@ -1725,9 +1725,10 @@ class InsertEdit
$html_output .= '';
}
- if (substr($column['pma_type'], 0, 8) === 'datetime') {
+ if (substr($column['pma_type'], 0, 4) === 'date') {
+ $type = substr($column['pma_type'], 0, 8) === 'datetime' ? 'datetime' : 'date';
$html_output .= '';
+ . $column_name_appendix . '" value="' . $type . '">';
}
if ($column['True_Type'] === 'bit') {
$html_output .= 'dbi->escapeString($current_value)
. "'";
- } elseif (! ($type === 'datetime' || $type === 'timestamp')
+ } elseif (! ($type === 'datetime' || $type === 'timestamp' || $type === 'date')
|| ($current_value !== 'CURRENT_TIMESTAMP'
&& $current_value !== 'current_timestamp()')
) {
diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php
index 193b8d89f9..0c977f8f01 100644
--- a/test/classes/InsertEditTest.php
+++ b/test/classes/InsertEditTest.php
@@ -2182,6 +2182,35 @@ class InsertEditTest extends AbstractTestCase
'',
$result
);
+
+ // case 4: (else -> date)
+ $column['pma_type'] = 'date';
+ $result = $this->callFunction(
+ $this->insertEdit,
+ InsertEdit::class,
+ 'getValueColumnForOtherDatatypes',
+ [
+ $column,
+ 'defchar',
+ 'a',
+ 'b',
+ 'c',
+ 22,
+ '<',
+ 12,
+ 1,
+ '/',
+ '<',
+ "foo\nbar",
+ $extracted_columnspec,
+ false,
+ ]
+ );
+
+ $this->assertStringContainsString(
+ '',
+ $result
+ );
}
/**