From 7fc3d760726cc599212832d8ae67298179e795cd Mon Sep 17 00:00:00 2001 From: Erik Fercak Date: Fri, 21 Feb 2014 14:08:07 +0100 Subject: [PATCH] Add aposthrophes back to dates Commit 7318658017 removed apostrophes from dates and that caused dibi to build different queries. Compare: ...WHERE `date_created` < '2014-02-21'; vs. ...WHERE `date_created` < 2014-02-21; --- dibi/drivers/DibiFirebirdDriver.php | 2 +- dibi/drivers/DibiMsSql2005Driver.php | 2 +- dibi/drivers/DibiMsSqlDriver.php | 2 +- dibi/drivers/DibiMySqlDriver.php | 2 +- dibi/drivers/DibiMySqliDriver.php | 2 +- dibi/drivers/DibiPdoDriver.php | 2 +- dibi/drivers/DibiPostgreDriver.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dibi/drivers/DibiFirebirdDriver.php b/dibi/drivers/DibiFirebirdDriver.php index c3066ac9..c9b64d11 100644 --- a/dibi/drivers/DibiFirebirdDriver.php +++ b/dibi/drivers/DibiFirebirdDriver.php @@ -281,7 +281,7 @@ class DibiFirebirdDriver extends DibiObject implements IDibiDriver, IDibiResultD if (!$value instanceof DateTime) { $value = new DibiDateTime($value); } - return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "Y-m-d"); + return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "'Y-m-d'"); default: throw new InvalidArgumentException('Unsupported type.'); diff --git a/dibi/drivers/DibiMsSql2005Driver.php b/dibi/drivers/DibiMsSql2005Driver.php index 2c354164..5ea74823 100644 --- a/dibi/drivers/DibiMsSql2005Driver.php +++ b/dibi/drivers/DibiMsSql2005Driver.php @@ -237,7 +237,7 @@ class DibiMsSql2005Driver extends DibiObject implements IDibiDriver, IDibiResult if (!$value instanceof DateTime) { $value = new DibiDateTime($value); } - return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "Y-m-d"); + return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "'Y-m-d'"); default: throw new InvalidArgumentException('Unsupported type.'); diff --git a/dibi/drivers/DibiMsSqlDriver.php b/dibi/drivers/DibiMsSqlDriver.php index 9cc54d85..9ba26bd2 100644 --- a/dibi/drivers/DibiMsSqlDriver.php +++ b/dibi/drivers/DibiMsSqlDriver.php @@ -222,7 +222,7 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv if (!$value instanceof DateTime) { $value = new DibiDateTime($value); } - return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "Y-m-d"); + return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "'Y-m-d'"); default: throw new InvalidArgumentException('Unsupported type.'); diff --git a/dibi/drivers/DibiMySqlDriver.php b/dibi/drivers/DibiMySqlDriver.php index 44841ef3..1d932240 100644 --- a/dibi/drivers/DibiMySqlDriver.php +++ b/dibi/drivers/DibiMySqlDriver.php @@ -316,7 +316,7 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv if (!$value instanceof DateTime) { $value = new DibiDateTime($value); } - return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "Y-m-d"); + return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "'Y-m-d'"); default: throw new InvalidArgumentException('Unsupported type.'); diff --git a/dibi/drivers/DibiMySqliDriver.php b/dibi/drivers/DibiMySqliDriver.php index 071693aa..b8a1948f 100644 --- a/dibi/drivers/DibiMySqliDriver.php +++ b/dibi/drivers/DibiMySqliDriver.php @@ -304,7 +304,7 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver, IDibiResultDri if (!$value instanceof DateTime) { $value = new DibiDateTime($value); } - return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "Y-m-d"); + return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "'Y-m-d'"); default: throw new InvalidArgumentException('Unsupported type.'); diff --git a/dibi/drivers/DibiPdoDriver.php b/dibi/drivers/DibiPdoDriver.php index 326e202f..9a4338f7 100644 --- a/dibi/drivers/DibiPdoDriver.php +++ b/dibi/drivers/DibiPdoDriver.php @@ -282,7 +282,7 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver if (!$value instanceof DateTime) { $value = new DibiDateTime($value); } - return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "Y-m-d"); + return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "'Y-m-d'"); default: throw new InvalidArgumentException('Unsupported type.'); diff --git a/dibi/drivers/DibiPostgreDriver.php b/dibi/drivers/DibiPostgreDriver.php index 3b7020a5..3e66bf18 100644 --- a/dibi/drivers/DibiPostgreDriver.php +++ b/dibi/drivers/DibiPostgreDriver.php @@ -297,7 +297,7 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr if (!$value instanceof DateTime) { $value = new DibiDateTime($value); } - return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "Y-m-d"); + return $value->format($type === dibi::DATETIME ? "'Y-m-d H:i:s'" : "'Y-m-d'"); default: throw new InvalidArgumentException('Unsupported type.');