Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKamil Tekiela <tekiela246@gmail.com>2022-08-04 22:59:31 +0300
committerKamil Tekiela <tekiela246@gmail.com>2022-08-08 16:41:51 +0300
commit06d58c96622389d86a74e23bd709706857cbc11a (patch)
tree5b0fc0de3f64552b2fce1256ece16d1c3084d67e /test
parentd075fa56a2a26ce104db43a466caee6bc451b70f (diff)
Fix bug #17663
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/classes/InsertEditTest.php120
1 files changed, 120 insertions, 0 deletions
diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php
index 1c7ad8eee3..13ee204b74 100644
--- a/test/classes/InsertEditTest.php
+++ b/test/classes/InsertEditTest.php
@@ -2023,6 +2023,126 @@ class InsertEditTest extends AbstractTestCase
],
$result
);
+
+ // Test to see if a zero-string is not ignored
+ $result = $this->insertEdit->getQueryValuesForInsertAndUpdateInMultipleEdit(
+ $multi_edit_columns_name,
+ [],
+ '0',
+ [],
+ [],
+ false,
+ [],
+ [],
+ "'0'",
+ [],
+ '0',
+ []
+ );
+
+ $this->assertEquals(
+ [
+ ["`fld` = '0'"],
+ [],
+ ],
+ $result
+ );
+
+ // Can only happen when table contains blob field that was left unchanged during edit
+ $result = $this->insertEdit->getQueryValuesForInsertAndUpdateInMultipleEdit(
+ $multi_edit_columns_name,
+ [],
+ '',
+ [],
+ [],
+ false,
+ [],
+ [],
+ '',
+ [],
+ '0',
+ []
+ );
+
+ $this->assertEquals(
+ [
+ [],
+ [],
+ ],
+ $result
+ );
+
+ // Test to see if a field will be set to null when it wasn't null previously
+ $result = $this->insertEdit->getQueryValuesForInsertAndUpdateInMultipleEdit(
+ $multi_edit_columns_name,
+ ['on'],
+ '',
+ [],
+ [],
+ false,
+ [],
+ [],
+ 'NULL',
+ [],
+ '0',
+ []
+ );
+
+ $this->assertEquals(
+ [
+ ['`fld` = NULL'],
+ [],
+ ],
+ $result
+ );
+
+ // Test to see if a field will be ignored if it was null previously
+ $result = $this->insertEdit->getQueryValuesForInsertAndUpdateInMultipleEdit(
+ $multi_edit_columns_name,
+ ['on'],
+ '',
+ [],
+ [],
+ false,
+ [],
+ [],
+ 'NULL',
+ [],
+ '0',
+ ['on']
+ );
+
+ $this->assertEquals(
+ [
+ [],
+ [],
+ ],
+ $result
+ );
+
+ // Test to see if a field will be ignored if it the value is unchanged
+ $result = $this->insertEdit->getQueryValuesForInsertAndUpdateInMultipleEdit(
+ $multi_edit_columns_name,
+ [],
+ "a'b",
+ ["a'b"],
+ [],
+ false,
+ [],
+ [],
+ "'a\'b'",
+ [],
+ '0',
+ []
+ );
+
+ $this->assertEquals(
+ [
+ [],
+ [],
+ ],
+ $result
+ );
}
/**