From 2ca80b1aa3b13aaa4c9f1df2c53f839af03a833f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E9=87=91=E5=8B=87?= Date: Wed, 19 Apr 2023 00:53:12 +0000 Subject: [PATCH] * Fix bug#34346. --- db/update18.3.sql | 5 +++++ db/zentao.sql | 6 +++--- lib/base/dao/dao.class.php | 7 ++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/db/update18.3.sql b/db/update18.3.sql index 112a708815..6b4a0a56fe 100644 --- a/db/update18.3.sql +++ b/db/update18.3.sql @@ -744,6 +744,9 @@ CHANGE `team` `team` varchar(90) NOT NULL DEFAULT '', CHANGE `whitelist` `whitelist` text NULL, CHANGE `order` `order` mediumint unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `zt_projectstory` +CHANGE `branch` `branch` mediumint unsigned NOT NULL DEFAULT '0'; + ALTER TABLE `zt_relation` CHANGE `project` `project` mediumint NOT NULL DEFAULT '0', CHANGE `product` `product` mediumint NOT NULL DEFAULT '0', @@ -924,6 +927,8 @@ CHANGE `lastEditedBy` `lastEditedBy` char(30) NOT NULL DEFAULT '', CHANGE `lastEditedDate` `lastEditedDate` datetime NULL; ALTER TABLE `zt_testtask` +CHANGE `report` `report` text NULL, +CHANGE `testreport` `testreport` mediumint unsigned NOT NULL DEFAULT '0', CHANGE `realFinishedDate` `realFinishedDate` datetime NULL; ALTER TABLE `zt_ticket` diff --git a/db/zentao.sql b/db/zentao.sql index 3ea8a5bb48..4b13c0b5f1 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1369,7 +1369,7 @@ CREATE UNIQUE INDEX `project` ON `zt_projectspec`(`project`,`version`); CREATE TABLE IF NOT EXISTS `zt_projectstory` ( `project` mediumint(8) unsigned NOT NULL default '0', `product` mediumint(8) unsigned NOT NULL, - `branch` mediumint(8) unsigned NOT NULL, + `branch` mediumint(8) unsigned NOT NULL DEFAULT '0', `story` mediumint(8) unsigned NOT NULL default '0', `version` smallint(6) NOT NULL default '1', `order` smallint(6) unsigned NOT NULL, @@ -1872,9 +1872,9 @@ CREATE TABLE IF NOT EXISTS `zt_testtask` ( `realFinishedDate` datetime NULL, `mailto` text, `desc` mediumtext NOT NULL, - `report` text NOT NULL, + `report` text NULL, `status` enum('blocked','doing','wait','done') NOT NULL DEFAULT 'wait', - `testreport` mediumint(8) unsigned NOT NULL, + `testreport` mediumint(8) unsigned NOT NULL DEFAULT '0', `auto` varchar(10) NOT NULL DEFAULT 'no', `subStatus` varchar(30) NOT NULL default '', `createdBy` varchar(30) NOT NULL, diff --git a/lib/base/dao/dao.class.php b/lib/base/dao/dao.class.php index 6339b93455..0e9c1d6dd5 100644 --- a/lib/base/dao/dao.class.php +++ b/lib/base/dao/dao.class.php @@ -1601,6 +1601,7 @@ class baseSQL { global $dbh; $this->dbh = $dbh; + $this->data = new stdclass(); $this->magicQuote = (version_compare(phpversion(), '5.4', '<') and function_exists('get_magic_quotes_gpc') and get_magic_quotes_gpc()); } @@ -1790,8 +1791,8 @@ class baseSQL if($this->method == 'insert') { - $this->setField = $value; - $this->data->$value = ''; + $this->setField = $set; + $this->data->$set = ''; } else { @@ -2093,7 +2094,7 @@ class baseSQL public function in($ids) { if($this->inCondition and !$this->conditionIsTrue) return $this; - $this->sql .= helper::dbIN($ids); + $this->sql .= $ids === NULL ? ' IS NULL' : helper::dbIN($ids); return $this; }