diff options
author | xue <> | 2006-08-26 15:56:39 +0000 |
---|---|---|
committer | xue <> | 2006-08-26 15:56:39 +0000 |
commit | cd101c35450db0740e70f7fb9587ed88566218f5 (patch) | |
tree | aea041dccab59f628672ca26a8d8b26a8b17aaf7 | |
parent | 79e00e70a50b89b627f5457d176084fbb192c5bd (diff) |
Fixed #336.
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | framework/Caching/TSqliteCache.php | 4 |
2 files changed, 3 insertions, 2 deletions
@@ -2,6 +2,7 @@ Version 3.0.4 September 3, 2006 =============================== BUG: Fixed a bug that would prevent from using <prop:> tag in skins (Qiang) BUG: Fixed a typo in TControl::setCustomData() (Qiang) +ENH: Ticket#336 - Speed up TSqliteCache with LIMIT SQL clause (Qiang) ENH: TListControl.SelectedValues and SelectedIndices can now be set before databinding (Qiang) ENH: Upgrade Scriptaculous javascript library to 1.6.2 (Wei) CHG: Unify all client-side javascript event handler syntax. (Wei) diff --git a/framework/Caching/TSqliteCache.php b/framework/Caching/TSqliteCache.php index b94b39fe..acf42906 100644 --- a/framework/Caching/TSqliteCache.php +++ b/framework/Caching/TSqliteCache.php @@ -117,7 +117,7 @@ class TSqliteCache extends TCache $error='';
if(($this->_db=new SQLiteDatabase($this->_file,0666,$error))===false)
throw new TConfigurationException('sqlitecache_connection_failed',$error);
- if(($res=$this->_db->query('SELECT * FROM sqlite_master WHERE tbl_name=\''.self::CACHE_TABLE.'\' AND type=\'table\''))!=false)
+ if(($res=$this->_db->query('SELECT * FROM sqlite_master WHERE tbl_name=\''.self::CACHE_TABLE.'\' AND type=\'table\' LIMIT 1'))!=false)
{
if($res->numRows()===0)
{
@@ -161,7 +161,7 @@ class TSqliteCache extends TCache */
protected function getValue($key)
{
- $sql='SELECT value FROM '.self::CACHE_TABLE.' WHERE key=\''.$key.'\' AND (expire=0 OR expire>'.time().')';
+ $sql='SELECT value FROM '.self::CACHE_TABLE.' WHERE key=\''.$key.'\' AND (expire=0 OR expire>'.time().') LIMIT 1';
if(($ret=$this->_db->query($sql))!=false && ($row=$ret->fetch(SQLITE_ASSOC))!==false)
return $row['value'];
else
|