From ee0aa395a27d3c69b795801ac201a45d1fd0feba Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 15 Dec 2011 10:34:35 +0000 Subject: [PATCH] Sql: Sql0 (without session) git-svn-id: svn://ultimatepp.org/upp/trunk@4305 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Sql/Session.cpp | 4 ++-- uppsrc/Sql/Sqls.h | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/uppsrc/Sql/Session.cpp b/uppsrc/Sql/Session.cpp index 9e58386ba..f33447748 100644 --- a/uppsrc/Sql/Session.cpp +++ b/uppsrc/Sql/Session.cpp @@ -153,7 +153,7 @@ Sql& AppCursor() return sGlobalSession->GetSessionSql(); static Sql *empty; ONCELOCK { - static Sql h(Sql::NULLSQL); + static Sql0 h; empty = &h; } return *empty; @@ -175,7 +175,7 @@ Sql& AppCursorR() return sGlobalSession->GetSessionSqlR(); static Sql *empty; ONCELOCK { - static Sql h(Sql::NULLSQL); + static Sql0 h; empty = &h; } return *empty; diff --git a/uppsrc/Sql/Sqls.h b/uppsrc/Sql/Sqls.h index b7995ed50..3ea54c56a 100644 --- a/uppsrc/Sql/Sqls.h +++ b/uppsrc/Sql/Sqls.h @@ -92,8 +92,6 @@ class Sql { friend Sql& AppCursorR(); Value Select0(const String& what); - enum _NULLSQL { NULLSQL }; - Sql(_NULLSQL) { cn = NULL; } public: void SetSession(SqlSource& src); @@ -251,6 +249,10 @@ private: Sql(const Sql&); }; +struct Sql0 : Sql { + Sql0() : Sql((SqlConnection *)NULL) {} +}; + #ifndef NOAPPSQL struct SqlR : Sql { SqlR();