Refactor AppRegistry to support multi-thread concurrency
[platform/framework/native/appfw.git] / src / io / FIo_DatabaseImpl.cpp
index eda5577..9237e56 100644 (file)
@@ -1,5 +1,4 @@
 //
-// Open Service Platform
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
 // Licensed under the Apache License, Version 2.0 (the License);
@@ -597,8 +596,7 @@ _DatabaseImpl::CreateStatementN(const String& statement)
        _DbStatementImpl::GetInstance(*pDbStatement)->__pStmt = pSqlStmt;
        _DbStatementImpl::GetInstance(*pDbStatement)->__pDatabase = __pDatabase;
 
-       // "SELECT" or other statement?
-       if (strncasecmp(pStrStmt, "select", 5) == 0)
+       if (strncasecmp(pStrStmt, "select", 6) == 0)
        {
                _DbStatementImpl::GetInstance(*pDbStatement)->__stmtType = DB_STATEMENT_TYPE_SELECT;
        }
@@ -796,8 +794,7 @@ _DatabaseImpl::ExecuteSql(const String& sql, bool autoCommit)
                pSqlStr++;
        }
 
-       // "SELECT" or other statement?
-       if (strncasecmp(pSqlStr, "select", 5) == 0)
+       if (strncasecmp(pSqlStr, "select", 6) == 0)
        {
                r = E_INVALID_OPERATION;
                goto CATCH;
@@ -859,8 +856,7 @@ _DatabaseImpl::QueryN(const String& query)
                pQuery++;
        }
 
-       // "SELECT" or other statement?
-       if (strncasecmp(pQuery, "select", 5) != 0)
+       if ((strncasecmp(pQuery, "select", 6) != 0) && (strncasecmp(pQuery, "PRAGMA", 6) != 0))
        {
                r = E_INVALID_OPERATION;
                goto CATCH;