Skip to content
Snippets Groups Projects
Commit c85225cd authored by Carsten  Rose's avatar Carsten Rose
Browse files

Fixed problem: logic to handle missing table Form was wrong.

parent b817140d
No related branches found
No related tags found
1 merge request!4Handle space in '[value=]' query
...@@ -65,7 +65,7 @@ class DatabaseUpdate { ...@@ -65,7 +65,7 @@ class DatabaseUpdate {
private function getDatabaseVersion() { private function getDatabaseVersion() {
$row = $this->db->sql("SHOW TABLE STATUS WHERE Name='Form'", ROW_EXPECT_0_1); $row = $this->db->sql("SHOW TABLE STATUS WHERE Name='Form'", ROW_EXPECT_0_1);
if (count($row) == 1) { if (isset($row['Comment'])) {
$arr = explode('=', $row['Comment']); $arr = explode('=', $row['Comment']);
if (count($arr) != 2 || $arr[0] != 'Version' || $arr[1] == '') { if (count($arr) != 2 || $arr[0] != 'Version' || $arr[1] == '') {
return false; return false;
......
...@@ -255,7 +255,7 @@ class DatabaseTest extends AbstractDatabaseTest { ...@@ -255,7 +255,7 @@ class DatabaseTest extends AbstractDatabaseTest {
$rc = $this->db->sql($sql, ROW_REGULAR, $dummy, 'fake', $dummy, $stat); $rc = $this->db->sql($sql, ROW_REGULAR, $dummy, 'fake', $dummy, $stat);
// DB_NUM_ROWS | DB_INSERT_ID | DB_AFFECTED_ROWS // DB_NUM_ROWS | DB_INSERT_ID | DB_AFFECTED_ROWS
$this->assertEquals(5, $stat[DB_NUM_ROWS]); $this->assertEquals(6, $stat[DB_NUM_ROWS]);
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment