Modified:
trunk/ChangeLog
trunk/driver/connect.c
trunk/driver/myodbc3.h
trunk/setup/MYODBCSetupDataSourceDialog.cpp
trunk/setup/MYODBCSetupDataSourceTab3.cpp
trunk/setup/MYODBCSetupDataSourceTab3c.cpp
trunk/setup/MYODBCSetupDataSourceTab3c.h
trunk/test/my_basics.c
Log:
Added FLAG_MULTI_STATEMENTS to allow issuing queries that contain
multiple statements. Also added to the setup GUI. (Bug #7445)
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-07-29 17:22:06 UTC (rev 610)
+++ trunk/ChangeLog 2007-07-30 15:27:03 UTC (rev 611)
@@ -1,6 +1,8 @@
3.51.18
Functionality added or changed:
+ * Added FLAG_MULTI_STATEMENTS to allow issuing queries that contain
+ multiple statements. Also added to the setup GUI. (Bug #7445)
* Removed support for the TRACE and TRACEFILE DSN options. The standard
ODBC logging should be used.
Modified: trunk/driver/connect.c
===================================================================
--- trunk/driver/connect.c 2007-07-29 17:22:06 UTC (rev 610)
+++ trunk/driver/connect.c 2007-07-30 15:27:03 UTC (rev 611)
@@ -61,6 +61,8 @@
flags|= CLIENT_COMPRESS;
if (options & FLAG_IGNORE_SPACE)
flags|= CLIENT_IGNORE_SPACE;
+ if (options & FLAG_MULTI_STATEMENTS)
+ flags|= CLIENT_MULTI_STATEMENTS;
return flags;
}
Modified: trunk/driver/myodbc3.h
===================================================================
--- trunk/driver/myodbc3.h 2007-07-29 17:22:06 UTC (rev 610)
+++ trunk/driver/myodbc3.h 2007-07-30 15:27:03 UTC (rev 611)
@@ -164,6 +164,7 @@
#define FLAG_AUTO_IS_NULL (FLAG_SAFE << 6) /* 8388608 Enables SQL_AUTO_IS_NULL
*/
#define FLAG_ZERO_DATE_TO_MIN (1 << 24) /* Convert XXXX-00-00 date to ODBC min date
on results */
#define FLAG_MIN_DATE_TO_ZERO (1 << 25) /* Convert ODBC min date to 0000-00-00 on
query */
+#define FLAG_MULTI_STATEMENTS (1 << 26) /* Allow multiple statements in a query */
/* We don't make any assumption about what the default may be. */
#ifndef DEFAULT_TXN_ISOLATION
Modified: trunk/setup/MYODBCSetupDataSourceDialog.cpp
===================================================================
--- trunk/setup/MYODBCSetupDataSourceDialog.cpp 2007-07-29 17:22:06 UTC (rev 610)
+++ trunk/setup/MYODBCSetupDataSourceDialog.cpp 2007-07-30 15:27:03 UTC (rev 611)
@@ -422,6 +422,7 @@
ptab3->ptab3c->pcheckboxForceUseOfForwardOnlyCursors->setChecked(
nOptions & (1 << 21) ? TRUE : FALSE );
ptab3->ptab3a->pcheckboxEnableReconnect->setChecked( nOptions & (1
<< 22) ? TRUE : FALSE );
ptab3->ptab3a->pcheckboxAutoIncrementIsNull->setChecked( nOptions &
(1 << 23) ? TRUE : FALSE );
+ ptab3->ptab3c->pcheckboxMultiStatements->setChecked( nOptions & (1
<< 26) ? TRUE : FALSE );
}
connect( ppushbuttonTest, SIGNAL(clicked()), SLOT(slotTest()) );
@@ -467,6 +468,7 @@
connect( ptab3->ptab3c->pcheckboxReadOptionsFromMyCnf,
SIGNAL(signalAssistText(const QString&)), ptextbrowserAssist, SLOT(setHtml(const
QString&)) );
connect( ptab3->ptab3c->pcheckboxDisableTransactions,
SIGNAL(signalAssistText(const QString&)), ptextbrowserAssist, SLOT(setHtml(const
QString&)) );
connect( ptab3->ptab3c->pcheckboxForceUseOfForwardOnlyCursors,
SIGNAL(signalAssistText(const QString&)), ptextbrowserAssist, SLOT(setHtml(const
QString&)) );
+ connect( ptab3->ptab3c->pcheckboxMultiStatements, SIGNAL(signalAssistText(const
QString&)), ptextbrowserAssist, SLOT(setHtml(const QString&)) );
connect( ptab3->ptab3d->pcheckboxTraceDriverCalls,
SIGNAL(signalAssistText(const QString&)), ptextbrowserAssist, SLOT(setHtml(const
QString&)) );
connect( ptab3->ptab3d->pcheckboxSaveQueries, SIGNAL(signalAssistText(const
QString&)), ptextbrowserAssist, SLOT(setHtml(const QString&)) );
Modified: trunk/setup/MYODBCSetupDataSourceTab3.cpp
===================================================================
--- trunk/setup/MYODBCSetupDataSourceTab3.cpp 2007-07-29 17:22:06 UTC (rev 610)
+++ trunk/setup/MYODBCSetupDataSourceTab3.cpp 2007-07-30 15:27:03 UTC (rev 611)
@@ -98,6 +98,8 @@
nFlags |= 1 << 22;
if ( ptab3a->pcheckboxAutoIncrementIsNull->isChecked() )
nFlags |= 1 << 23;
+ if ( ptab3c->pcheckboxMultiStatements->isChecked() )
+ nFlags |= 1 << 26;
return nFlags;
}
Modified: trunk/setup/MYODBCSetupDataSourceTab3c.cpp
===================================================================
--- trunk/setup/MYODBCSetupDataSourceTab3c.cpp 2007-07-29 17:22:06 UTC (rev 610)
+++ trunk/setup/MYODBCSetupDataSourceTab3c.cpp 2007-07-30 15:27:03 UTC (rev 611)
@@ -30,6 +30,7 @@
QString stringReadOptionsFromMyCnf( tr("Read parameters from the [client] and
[odbc] groups from `my.cnf'.") );
QString stringDisableTransactions( tr("Disable transactions.") );
QString stringForceUseOfForwardOnlyCursors( tr("Force the use of Forward-only
cursor type. In case of applications setting the default static/dynamic cursor type, and
one wants driver to use non-cache result sets, then this option will ensure the
forward-only cursor behavior.") );
+ QString stringMultiStatements( tr("Allow multiple statements in a single
query.") );
#if QT_VERSION >= 0x040000
QVBoxLayout *playoutFields = new QVBoxLayout;
@@ -105,6 +106,15 @@
QToolTip::add( pcheckboxForceUseOfForwardOnlyCursors,
stringForceUseOfForwardOnlyCursors );
#endif
+ pcheckboxMultiStatements = new MYODBCSetupCheckBox( tr("Allow multiple statements"),
this );
+ pcheckboxMultiStatements->setAssistText( stringMultiStatements );
+ playoutFields->addWidget( pcheckboxMultiStatements );
+#if QT_VERSION >= 0x040000
+ pcheckboxMultiStatements->setToolTip( stringMultiStatements );
+#else
+ QToolTip::add( pcheckboxMultiStatements, stringMultiStatements );
+#endif
+
playoutFields->addStretch( 10 );
}
Modified: trunk/setup/MYODBCSetupDataSourceTab3c.h
===================================================================
--- trunk/setup/MYODBCSetupDataSourceTab3c.h 2007-07-29 17:22:06 UTC (rev 610)
+++ trunk/setup/MYODBCSetupDataSourceTab3c.h 2007-07-30 15:27:03 UTC (rev 611)
@@ -48,6 +48,7 @@
MYODBCSetupCheckBox *pcheckboxReadOptionsFromMyCnf;
MYODBCSetupCheckBox *pcheckboxDisableTransactions;
MYODBCSetupCheckBox *pcheckboxForceUseOfForwardOnlyCursors;
+ MYODBCSetupCheckBox *pcheckboxMultiStatements;
};
#endif
Modified: trunk/test/my_basics.c
===================================================================
--- trunk/test/my_basics.c 2007-07-29 17:22:06 UTC (rev 610)
+++ trunk/test/my_basics.c 2007-07-30 15:27:03 UTC (rev 611)
@@ -345,6 +345,50 @@
}
+/**
+ Bug #7445: MyODBC still doesn't support batch statements
+*/
+DECLARE_TEST(t_bug7445)
+{
+ SQLLEN nRowCount;
+ SQLHENV henv1;
+ SQLHDBC hdbc1;
+ SQLHSTMT hstmt1;
+
+ SET_DSN_OPTION(1 << 26);
+
+ alloc_basic_handles(&henv1, &hdbc1, &hstmt1);
+
+ ok_sql(hstmt1, "DROP TABLE IF EXISTS t_bug7445");
+
+ /* create the table 'myodbc3_demo_result' */
+ ok_sql(hstmt1,
+ "CREATE TABLE t_bug7445(name VARCHAR(20))");
+
+ /* multi statement insert */
+ ok_sql(hstmt1, "INSERT INTO t_bug7445 VALUES ('bogdan');"
+ "INSERT INTO t_bug7445 VALUES ('georg');"
+ "INSERT INTO t_bug7445 VALUES ('tonci');"
+ "INSERT INTO t_bug7445 VALUES ('jim')");
+
+ ok_sql(hstmt1, "SELECT COUNT(*) FROM t_bug7445");
+
+ /* get the rows affected by update statement */
+ ok_stmt(hstmt1, SQLRowCount(hstmt1, &nRowCount));
+ is_num(nRowCount, 1);
+
+ ok_stmt(hstmt1, SQLFreeStmt(hstmt1, SQL_CLOSE));
+
+ ok_sql(hstmt1, "DROP TABLE t_bug7445");
+
+ free_basic_handles(&henv1, &hdbc1, &hstmt1);
+
+ SET_DSN_OPTION(0);
+
+ return OK;
+}
+
+
BEGIN_TESTS
ADD_TEST(my_basics)
ADD_TEST(t_max_select)
@@ -356,6 +400,7 @@
#endif
ADD_TEST(charset_utf8)
ADD_TEST(charset_gbk)
+ ADD_TEST(t_bug7445)
END_TESTS
| Thread |
|---|
| • Connector/ODBC 3.51 commit: r611 - in trunk: . driver setup test | jwinstead | 30 Jul |