List:Commits« Previous MessageNext Message »
From:ahristov Date:May 24 2007 1:36am
Subject:Connector/ODBC 5 commit: r937 - trunk/SDK/MYSQLPlus/Library
View as plain text  
Modified:
   trunk/SDK/MYSQLPlus/Library/MCommand.cpp
Log:
Last commit for today.


Modified: trunk/SDK/MYSQLPlus/Library/MCommand.cpp
===================================================================
--- trunk/SDK/MYSQLPlus/Library/MCommand.cpp	2007-05-23 23:07:42 UTC (rev 936)
+++ trunk/SDK/MYSQLPlus/Library/MCommand.cpp	2007-05-23 23:36:11 UTC (rev 937)
@@ -552,9 +552,10 @@
         if (bLastChar)
         {
             /* mismatched quote */
-            if ((!cQuote.isNull() && cChar != cQuote) ||                /* last
char is not going to close our quote            */
-                 (cQuote.isNull() && stringQuotes.contains(cChar)))   /* last
char is going to open a quote                   */
-                DBUG_RETURN(getDiagnostic()->doAppend(MDiagnostic::STATE_HY000, 0,
QString("mismatched quote near: ").arg(stringText)));
+            if ((!cQuote.isNull() && cChar != cQuote) ||              /* last
char is not going to close our quote */
+                 (cQuote.isNull() && stringQuotes.contains(cChar)))   /* last
char is going to open a quote        */
+                DBUG_RETURN(getDiagnostic()->doAppend(MDiagnostic::STATE_HY000, 0,
+                                                      QString("mismatched quote near:
").arg(stringText)));
 
             /* mismatched brace */
             if (bBraceCheck &&
@@ -562,7 +563,8 @@
                    (nBraceNest == 0 && (cChar == cBraceOpen || cChar ==
cBraceClose)) ||
                     nBraceNest > 1 ||
                     nBraceNest < 0))
-                DBUG_RETURN(getDiagnostic()->doAppend(MDiagnostic::STATE_HY000, 0,
QString("mismatched brace near: ").arg(stringText)));
+                DBUG_RETURN(getDiagnostic()->doAppend(MDiagnostic::STATE_HY000, 0,
+                                                      QString("mismatched brace near:
").arg(stringText)));
         }
 
         /* brace opening (not in quotes) */
@@ -636,32 +638,23 @@
         - detect SELECT INTO
         - support for more keywords/types
     */
-    if (this->stringText
-    		.startsWith("SELECT ", Qt::CaseInsensitive))
+    if (this->stringText.startsWith("SELECT ", Qt::CaseInsensitive))
         nType = COMMAND_TYPE_SELECT;
-    else if (this->stringText
-    		.startsWith("SHOW ", Qt::CaseInsensitive))
+    else if (this->stringText.startsWith("SHOW ", Qt::CaseInsensitive))
         nType = COMMAND_TYPE_SHOW;
-    else if (this->stringText
-    		.startsWith("UPDATE ", Qt::CaseInsensitive))
+    else if (this->stringText.startsWith("UPDATE ", Qt::CaseInsensitive))
         nType = COMMAND_TYPE_UPDATE;
-    else if (this->stringText
-    		.startsWith("DELETE ", Qt::CaseInsensitive))
+    else if (this->stringText.startsWith("DELETE ", Qt::CaseInsensitive))
         nType = COMMAND_TYPE_DELETE;
-    else if (this->stringText
-    		.startsWith("INSERT ", Qt::CaseInsensitive))
+    else if (this->stringText.startsWith("INSERT ", Qt::CaseInsensitive))
         nType = COMMAND_TYPE_INSERT;
-    else if (this->stringText
-    		.startsWith("CALL ", Qt::CaseInsensitive))
+    else if (this->stringText.startsWith("CALL ", Qt::CaseInsensitive))
         nType = COMMAND_TYPE_CALL;
-    else if (this->stringText
-    		.startsWith("CREATE ", Qt::CaseInsensitive))
+    else if (this->stringText.startsWith("CREATE ", Qt::CaseInsensitive))
         nType = COMMAND_TYPE_CREATE;
-    else if (this->stringText
-    		.startsWith("GRANT ", Qt::CaseInsensitive))
+    else if (this->stringText.startsWith("GRANT ", Qt::CaseInsensitive))
         nType = COMMAND_TYPE_GRANT;
-    else if (this->stringText
-    		.startsWith("SET ", Qt::CaseInsensitive))
+    else if (this->stringText.startsWith("SET ", Qt::CaseInsensitive))
         nType = COMMAND_TYPE_SET;
     else
         nType = COMMAND_TYPE_UNKNOWN;
@@ -698,8 +691,6 @@
 MConnection *MCommand::getConnection()
 {
     DBUG_ENTER("MCommand::getConnection");
-
-    DBUG_PRINT("oreturn", ("%p", getCommands()->getConnection()));
     DBUG_RETURN(getCommands()->getConnection());
 }
 
@@ -713,16 +704,12 @@
 MDiagnostic *MCommand::getDiagnostic()
 {
     DBUG_ENTER("MCommand::getDiagnostic");
-
-    DBUG_PRINT("oreturn", ("%p", getCommands()->getDiagnostic()));
     DBUG_RETURN(getCommands()->getDiagnostic());
 }
 
 MStatement *MCommand::getStatement()
 {
     DBUG_ENTER("MCommand::getStatement");
-
-    DBUG_PRINT("oreturn", ("%p", getCommands()->getStatement()));
     DBUG_RETURN(getCommands()->getStatement());
 }
 
@@ -792,7 +779,7 @@
 
         default:
             DBUG_RETURN(getDiagnostic()->doAppend(MDiagnostic::STATE_HY000, 0,
-                                                   QString(QObject::tr("Unknown statement
type %1")).arg(nStatementType)));
+                                                  QString(QObject::tr("Unknown statement
type %1")).arg(nStatementType)));
     }
 
     if (!pResult)
@@ -822,13 +809,13 @@
 
     if (getState() <= nState)
         DBUG_RETURN(getDiagnostic()->doAppend(MDiagnostic::STATE_01000, 0,
-                                               QObject::tr("Request to roll back state
has no affect.")));
+                                              QObject::tr("Request to roll back state has
no affect.")));
 
     switch (getState())
     {
         case STATE_UNINITIALIZED:
             DBUG_RETURN(getDiagnostic()->doAppend(MDiagnostic::STATE_HY000, 0,
-                                                   QObject::tr("Invalid state; no state
before STATE_UNINITIALIZED.")));
+                                                  QObject::tr("Invalid state; no state
before STATE_UNINITIALIZED.")));
             break;
 
         case STATE_INITIALIZED:

Thread
Connector/ODBC 5 commit: r937 - trunk/SDK/MYSQLPlus/Libraryahristov24 May