summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2018-10-11 22:49:27 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2018-10-11 22:49:27 +0200
commitddff78ab18fd31f975dba5d55daa1b15f171c97d (patch)
tree25a640a5e4db1237f3197be7680836f8e3f631a2
parentcce151f010da6891d88c5a848d0a5eb4b5f7d2f6 (diff)
parent5d6daa6f1588760c8c535ed3ef19ad23da212a18 (diff)
downloadmariadb-git-ddff78ab18fd31f975dba5d55daa1b15f171c97d.tar.gz
Merge branch 'ob-10.1' into 10.1
-rw-r--r--storage/connect/connect.cc2
-rw-r--r--storage/connect/global.h4
-rw-r--r--storage/connect/ha_connect.cc96
-rw-r--r--storage/connect/ha_connect.h6
-rw-r--r--storage/connect/mysql-test/connect/disabled.def2
-rw-r--r--storage/connect/mysql-test/connect/r/jdbc.result12
-rw-r--r--storage/connect/mysql-test/connect/r/jdbc_postgresql.result10
-rw-r--r--storage/connect/mysql-test/connect/r/mysql_exec.result6
-rw-r--r--storage/connect/mysql-test/connect/r/odbc_postgresql.result18
-rw-r--r--storage/connect/mysql-test/connect/r/vcol.result2
-rw-r--r--storage/connect/mysql-test/connect/t/vcol.test2
-rw-r--r--storage/connect/odbconn.cpp10
-rw-r--r--storage/connect/tabext.cpp6
-rw-r--r--storage/connect/tabjdbc.cpp9
-rw-r--r--storage/connect/tabmysql.cpp11
-rw-r--r--storage/connect/tabodbc.cpp13
16 files changed, 154 insertions, 55 deletions
diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc
index 39123b18c59..21bca637eab 100644
--- a/storage/connect/connect.cc
+++ b/storage/connect/connect.cc
@@ -254,7 +254,7 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2,
try {
if (!c1) {
- if (mode == MODE_INSERT)
+// if (mode == MODE_INSERT) or CHECK TABLE
// Allocate all column blocks for that table
tdbp->ColDB(g, NULL, 0);
diff --git a/storage/connect/global.h b/storage/connect/global.h
index 472d09408c3..36e8a311124 100644
--- a/storage/connect/global.h
+++ b/storage/connect/global.h
@@ -1,7 +1,7 @@
/***********************************************************************/
/* GLOBAL.H: Declaration file used by all CONNECT implementations. */
/* (C) Copyright MariaDB Corporation Ab */
-/* Author Olivier Bertrand 1993-2017 */
+/* Author Olivier Bertrand 1993-2018 */
/***********************************************************************/
/***********************************************************************/
@@ -192,7 +192,7 @@ typedef struct _global { /* Global structure */
PACTIVITY Activityp;
char Message[MAX_STR];
ulong More; /* Used by jsonudf */
- int Createas; /* To pass info to created table */
+ int Createas; /* To pass multi to ext tables */
void *Xchk; /* indexes in create/alter */
short Alchecked; /* Checked for ALTER */
short Mrr; /* True when doing mrr */
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 8811030e751..c9d8d34bd86 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -170,9 +170,9 @@
#define JSONMAX 10 // JSON Default max grp size
extern "C" {
- char version[]= "Version 1.06.0007 August 06, 2018";
+ char version[]= "Version 1.06.0008 October 06, 2018";
#if defined(__WIN__)
- char compver[]= "Version 1.06.0007 " __DATE__ " " __TIME__;
+ char compver[]= "Version 1.06.0008 " __DATE__ " " __TIME__;
char slash= '\\';
#else // !__WIN__
char slash= '/';
@@ -3290,6 +3290,58 @@ ha_rows ha_connect::records()
} // end of records
+int ha_connect::check(THD* thd, HA_CHECK_OPT* check_opt)
+{
+ int rc = HA_ADMIN_OK;
+ PGLOBAL g = ((table && table->in_use) ? GetPlug(table->in_use, xp) :
+ (xp) ? xp->g : NULL);
+ DBUG_ENTER("ha_connect::check");
+
+ if (!g || !table || xmod != MODE_READ)
+ DBUG_RETURN(HA_ADMIN_INTERNAL_ERROR);
+
+ // Do not close the table if it was opened yet (possible?)
+ if (IsOpened()) {
+ if (IsPartitioned() && CheckColumnList(g)) // map can have been changed
+ rc = HA_ADMIN_CORRUPT;
+ else if (tdbp->OpenDB(g)) // Rewind table
+ rc = HA_ADMIN_CORRUPT;
+
+ } else if (xp->CheckQuery(valid_query_id)) {
+ tdbp = NULL; // Not valid anymore
+
+ if (OpenTable(g, false))
+ rc = HA_ADMIN_CORRUPT;
+
+ } else // possible?
+ DBUG_RETURN(HA_ADMIN_INTERNAL_ERROR);
+
+ if (rc == HA_ADMIN_OK) {
+ TABTYPE type = GetTypeID(GetStringOption("Type", "*"));
+
+ if (IsFileType(type)) {
+ if (check_opt->flags & T_MEDIUM) {
+ // TO DO
+ do {
+ if ((rc = CntReadNext(g, tdbp)) == RC_FX)
+ break;
+
+ } while (rc != RC_EF);
+
+ rc = (rc == RC_EF) ? HA_ADMIN_OK : HA_ADMIN_CORRUPT;
+ } else if (check_opt->flags & T_EXTEND) {
+ // TO DO
+ } // endif's flags
+
+ } // endif file type
+
+ } else
+ PushWarning(g, thd, 1);
+
+ DBUG_RETURN(rc);
+} // end of check
+
+
/**
Return an error message specific to this handler.
@@ -3309,7 +3361,8 @@ bool ha_connect::get_error_message(int error, String* buf)
if (trace(1))
htrc("GEM(%d): %s\n", error, g->Message);
- buf->append(g->Message);
+ buf->append(ErrConvString(g->Message, strlen(g->Message),
+ &my_charset_latin1).ptr());
} else
buf->append("Cannot retrieve error message");
@@ -3424,7 +3477,7 @@ int ha_connect::optimize(THD* thd, HA_CHECK_OPT*)
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
rc = 0;
} else
- rc = HA_ERR_INTERNAL_ERROR;
+ rc = HA_ERR_CRASHED_ON_USAGE; // Table must be repaired
} // endif rc
@@ -3440,6 +3493,9 @@ int ha_connect::optimize(THD* thd, HA_CHECK_OPT*)
rc = HA_ERR_INTERNAL_ERROR;
} // end catch
+ if (rc)
+ my_message(ER_WARN_DATA_OUT_OF_RANGE, g->Message, MYF(0));
+
return rc;
} // end of optimize
@@ -4501,14 +4557,16 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd,
// case SQLCOM_REPLACE_SELECT:
// newmode= MODE_UPDATE; // To be checked
// break;
- case SQLCOM_DELETE:
- case SQLCOM_DELETE_MULTI:
+ case SQLCOM_DELETE_MULTI:
+ *cras = true;
+ case SQLCOM_DELETE:
case SQLCOM_TRUNCATE:
newmode= MODE_DELETE;
break;
- case SQLCOM_UPDATE:
case SQLCOM_UPDATE_MULTI:
- newmode= MODE_UPDATE;
+ *cras = true;
+ case SQLCOM_UPDATE:
+ newmode= MODE_UPDATE;
break;
case SQLCOM_SELECT:
case SQLCOM_OPTIMIZE:
@@ -4533,8 +4591,10 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd,
newmode= MODE_ANY;
break;
// } // endif partitioned
-
- default:
+ case SQLCOM_REPAIR: // TODO implement it
+ newmode = MODE_UPDATE;
+ break;
+ default:
htrc("Unsupported sql_command=%d\n", thd_sql_command(thd));
strcpy(g->Message, "CONNECT Unsupported command");
my_message(ER_NOT_ALLOWED_COMMAND, g->Message, MYF(0));
@@ -4546,17 +4606,18 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd,
switch (thd_sql_command(thd)) {
case SQLCOM_CREATE_TABLE:
*chk= true;
- *cras= true;
+ break;
+ case SQLCOM_UPDATE_MULTI:
+ case SQLCOM_DELETE_MULTI:
+ *cras= true;
case SQLCOM_INSERT:
case SQLCOM_LOAD:
case SQLCOM_INSERT_SELECT:
// case SQLCOM_REPLACE:
// case SQLCOM_REPLACE_SELECT:
case SQLCOM_DELETE:
- case SQLCOM_DELETE_MULTI:
case SQLCOM_TRUNCATE:
case SQLCOM_UPDATE:
- case SQLCOM_UPDATE_MULTI:
case SQLCOM_SELECT:
case SQLCOM_OPTIMIZE:
case SQLCOM_SET_OPTION:
@@ -4584,8 +4645,9 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd,
break;
// } // endif partitioned
- case SQLCOM_CHECK: // TODO implement it
- case SQLCOM_END: // Met in procedures: IF(EXISTS(SELECT...
+ case SQLCOM_CHECK: // TODO implement it
+ case SQLCOM_ANALYZE: // TODO implement it
+ case SQLCOM_END: // Met in procedures: IF(EXISTS(SELECT...
newmode= MODE_READ;
break;
default:
@@ -4867,7 +4929,7 @@ int ha_connect::external_lock(THD *thd, int lock_type)
#endif // 0
if (cras)
- g->Createas= 1; // To tell created table to ignore FLAG
+ g->Createas= 1; // To tell external tables of a multi-table command
if (trace(1)) {
#if 0
@@ -7248,7 +7310,7 @@ maria_declare_plugin(connect)
0x0107, /* version number (1.05) */
NULL, /* status variables */
connect_system_variables, /* system variables */
- "1.06.0007", /* string version */
+ "1.06.0008", /* string version */
MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
}
maria_declare_plugin_end;
diff --git a/storage/connect/ha_connect.h b/storage/connect/ha_connect.h
index 4c5bf5856cc..07b1c2d2e7d 100644
--- a/storage/connect/ha_connect.h
+++ b/storage/connect/ha_connect.h
@@ -347,11 +347,7 @@ PFIL CondFilter(PGLOBAL g, Item *cond);
//PFIL CheckFilter(PGLOBAL g);
/** admin commands - called from mysql_admin_table */
-virtual int check(THD* thd, HA_CHECK_OPT* check_opt)
-{
- // TODO: implement it
- return HA_ADMIN_OK; // Just to avoid error message with checktables
-} // end of check
+virtual int check(THD* thd, HA_CHECK_OPT* check_opt);
/**
Number of rows in table. It will only be called if
diff --git a/storage/connect/mysql-test/connect/disabled.def b/storage/connect/mysql-test/connect/disabled.def
index 7273e13dc4f..1de4deb0a60 100644
--- a/storage/connect/mysql-test/connect/disabled.def
+++ b/storage/connect/mysql-test/connect/disabled.def
@@ -20,4 +20,4 @@ mongo_c : Need MongoDB running and its C Driver installed
mongo_java_2 : Need MongoDB running and its Java Driver installed
mongo_java_3 : Need MongoDB running and its Java Driver installed
tbl_thread : Bug MDEV-9844,10179,14214 03/01/2018 OB Option THREAD removed
-vcol : Different error code on different versions
+#vcol : Different error code on different versions
diff --git a/storage/connect/mysql-test/connect/r/jdbc.result b/storage/connect/mysql-test/connect/r/jdbc.result
index 1bcd7b736bb..6bf67ec416f 100644
--- a/storage/connect/mysql-test/connect/r/jdbc.result
+++ b/storage/connect/mysql-test/connect/r/jdbc.result
@@ -239,22 +239,34 @@ CREATE TABLE t2 (command varchar(128) not null,number int(5) not null flag=1,mes
SELECT * FROM t2 WHERE command='drop table tx1';
command number message
drop table tx1 0 Execute: java.sql.SQLSyntaxErrorException: (conn:23) Unknown table 'connect.tx1'
+Warnings:
+Warning 1105 Execute: java.sql.SQLSyntaxErrorException: (conn:23) Unknown table 'connect.tx1'
SELECT * FROM t2 WHERE command = 'create table tx1 (a int not null, b char(32), c double(8,2))';
command number message
create table tx1 (a int not null, b char(32), c double(8,2)) 0 Affected rows
+Warnings:
+Warning 1105 Affected rows
SELECT * FROM t2 WHERE command in ('insert into tx1 values(1,''The number one'',456.12)',"insert into tx1(a,b) values(2,'The number two'),(3,'The number three')");
command number message
insert into tx1 values(1,'The number one',456.12) 1 Affected rows
insert into tx1(a,b) values(2,'The number two'),(3,'The number three') 2 Affected rows
+Warnings:
+Warning 1105 Affected rows
SELECT * FROM t2 WHERE command='update tx1 set c = 3.1416 where a = 2';
command number message
update tx1 set c = 3.1416 where a = 2 1 Affected rows
+Warnings:
+Warning 1105 Affected rows
SELECT * FROM t2 WHERE command='select * from tx1';
command number message
select * from tx1 3 Result set column number
+Warnings:
+Warning 1105 Result set column number
SELECT * FROM t2 WHERE command='delete from tx1 where a = 2';
command number message
delete from tx1 where a = 2 1 Affected rows
+Warnings:
+Warning 1105 Affected rows
SELECT * FROM connect.tx1;
a b c
1 The number one 456.12
diff --git a/storage/connect/mysql-test/connect/r/jdbc_postgresql.result b/storage/connect/mysql-test/connect/r/jdbc_postgresql.result
index 7969672dd66..64707fc2ecf 100644
--- a/storage/connect/mysql-test/connect/r/jdbc_postgresql.result
+++ b/storage/connect/mysql-test/connect/r/jdbc_postgresql.result
@@ -1,4 +1,4 @@
-SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/JavaWrappers.jar;C:/Jconnectors/postgresql-42.2.1.jar';
+SET GLOBAL connect_class_path='C:/MariaDB-10.1/MariaDB/storage/connect/mysql-test/connect/std_data/JavaWrappers.jar;C:/Jconnectors/postgresql-42.2.1.jar';
CREATE TABLE t2 (
command varchar(128) not null,
number int(5) not null flag=1,
@@ -9,12 +9,18 @@ OPTION_LIST='Execsrc=1';
SELECT * FROM t2 WHERE command='drop table employee';
command number message
drop table employee 0 Execute: org.postgresql.util.PSQLException: ERREUR: la table « employee » n'existe pas
+Warnings:
+Warning 1105 Execute: org.postgresql.util.PSQLException: ERREUR: la table « employee » n'existe pas
SELECT * FROM t2 WHERE command = 'create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2))';
command number message
create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2)) 0 Affected rows
+Warnings:
+Warning 1105 Affected rows
SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'Engineer', 12560.50)";
command number message
insert into employee values(4567,'Johnson', 'Engineer', 12560.50) 1 Affected rows
+Warnings:
+Warning 1105 Affected rows
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables
CONNECTION='jdbc:postgresql://localhost/test?user=postgres&password=tinono'
OPTION_LIST='Tabtype=TABLE,Maxres=10';
@@ -63,4 +69,6 @@ DROP SERVER 'postgresql';
SELECT * FROM t2 WHERE command='drop table employee';
command number message
drop table employee 0 Affected rows
+Warnings:
+Warning 1105 Affected rows
DROP TABLE t2;
diff --git a/storage/connect/mysql-test/connect/r/mysql_exec.result b/storage/connect/mysql-test/connect/r/mysql_exec.result
index 483fbd9e6a6..add98a6235d 100644
--- a/storage/connect/mysql-test/connect/r/mysql_exec.result
+++ b/storage/connect/mysql-test/connect/r/mysql_exec.result
@@ -30,6 +30,8 @@ insert ignore into t1(id) values(NULL) 1 1 Affected rows
Warning 0 1364 Field 'msg' doesn't have a default value
update t1 set msg = 'Four' where id = 4 0 1 Affected rows
select * from t1 0 2 Result set columns
+Warnings:
+Warning 1105 Result set columns
#
# Checking Using Procedure
#
@@ -43,9 +45,13 @@ CALL p1('insert ignore into t1(id) values(NULL)');
command warnings number message
insert ignore into t1(id) values(NULL) 1 1 Affected rows
Warning 0 1364 Field 'msg' doesn't have a default value
+Warnings:
+Warning 1105 Affected rows
CALL p1('update t1 set msg = "Five" where id = 5');
command warnings number message
update t1 set msg = "Five" where id = 5 0 1 Affected rows
+Warnings:
+Warning 1105 Affected rows
DROP PROCEDURE p1;
DROP TABLE t1;
SELECT * FROM t1;
diff --git a/storage/connect/mysql-test/connect/r/odbc_postgresql.result b/storage/connect/mysql-test/connect/r/odbc_postgresql.result
index 3426d23e29c..dc23dbdb990 100644
--- a/storage/connect/mysql-test/connect/r/odbc_postgresql.result
+++ b/storage/connect/mysql-test/connect/r/odbc_postgresql.result
@@ -99,9 +99,9 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu
mtr public t1 a 4 int4 10 4 0 10 0
mtr public t2 a 4 int4 10 4 0 10 0
mtr public v1 a 4 int4 10 4 0 10 1
-mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0
-mtr schema1 t2 a 1 bpchar 10 60 NULL NULL 0
-mtr schema1 v1 a 1 bpchar 10 60 NULL NULL 1
+mtr schema1 t1 a 1 bpchar 10 40 NULL NULL 0
+mtr schema1 t2 a 1 bpchar 10 40 NULL NULL 0
+mtr schema1 v1 a 1 bpchar 10 40 NULL NULL 1
DROP TABLE t1;
# All columns in the schemas "public" and "schema1"
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.%.%';
@@ -110,16 +110,16 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu
mtr public t1 a 4 int4 10 4 0 10 0
mtr public t2 a 4 int4 10 4 0 10 0
mtr public v1 a 4 int4 10 4 0 10 1
-mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0
-mtr schema1 t2 a 1 bpchar 10 60 NULL NULL 0
-mtr schema1 v1 a 1 bpchar 10 60 NULL NULL 1
+mtr schema1 t1 a 1 bpchar 10 40 NULL NULL 0
+mtr schema1 t2 a 1 bpchar 10 40 NULL NULL 0
+mtr schema1 v1 a 1 bpchar 10 40 NULL NULL 1
DROP TABLE t1;
# All tables "t1" in all schemas
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.%.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
mtr public t1 a 4 int4 10 4 0 10 0
-mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0
+mtr schema1 t1 a 1 bpchar 10 40 NULL NULL 0
DROP TABLE t1;
# Table "t1" in the schema "public"
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.public.t1';
@@ -131,14 +131,14 @@ DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.schema1.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
-mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0
+mtr schema1 t1 a 1 bpchar 10 40 NULL NULL 0
DROP TABLE t1;
# All tables "t1" in all schemas (Catalog name is ignored by PostgreSQL)
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEnginePostgresql;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='xxx.%.t1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
mtr public t1 a 4 int4 10 4 0 10 0
-mtr schema1 t1 a 1 bpchar 10 60 NULL NULL 0
+mtr schema1 t1 a 1 bpchar 10 40 NULL NULL 0
DROP TABLE t1;
#
# Checking tables
diff --git a/storage/connect/mysql-test/connect/r/vcol.result b/storage/connect/mysql-test/connect/r/vcol.result
index e0fd37203e4..4c59a3b06d8 100644
--- a/storage/connect/mysql-test/connect/r/vcol.result
+++ b/storage/connect/mysql-test/connect/r/vcol.result
@@ -26,4 +26,4 @@ agehired int(3) as (floor(datediff(hired,birth)/365.25)),
index (agehired)
)
engine=CONNECT table_type=FIX file_name='boys.txt' mapped=YES lrecl=47 ending=1;
-ERROR 42000: Table handler doesn't support NULL in given index. Please change column 'agehired' to be NOT NULL or use another handler
+ERROR HY000: Key/Index cannot be defined on a non-stored computed column
diff --git a/storage/connect/mysql-test/connect/t/vcol.test b/storage/connect/mysql-test/connect/t/vcol.test
index cdf37175f41..88b822102d0 100644
--- a/storage/connect/mysql-test/connect/t/vcol.test
+++ b/storage/connect/mysql-test/connect/t/vcol.test
@@ -13,7 +13,7 @@ engine=CONNECT table_type=FIX file_name='boys.txt' mapped=YES lrecl=47 ending=1;
select * from t1;
drop table t1;
---error ER_NULL_COLUMN_IN_INDEX
+--error ER_KEY_BASED_ON_GENERATED_VIRTUAL_COLUMN
create table t1 (
#linenum int(6) not null default 0 special=rowid,
name char(12) not null,
diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp
index f7b1a43a95d..6687513fa6c 100644
--- a/storage/connect/odbconn.cpp
+++ b/storage/connect/odbconn.cpp
@@ -2354,11 +2354,11 @@ int ODBConn::GetCatInfo(CATPARM *cap)
if (!Check(rc))
ThrowDBX(rc, fnc, hstmt);
- rc = SQLNumResultCols(hstmt, &ncol);
-
- // n because we no more ignore the first column
- if ((n = (UWORD)qrp->Nbcol) > (UWORD)ncol)
- ThrowDBX(MSG(COL_NUM_MISM));
+ // Some data source do not implement SQLNumResultCols
+ if (Check(SQLNumResultCols(hstmt, &ncol)))
+ // n because we no more ignore the first column
+ if ((n = (UWORD)qrp->Nbcol) > (UWORD)ncol)
+ ThrowDBX(MSG(COL_NUM_MISM));
// Unconditional to handle STRBLK's
pval = (PVAL *)PlugSubAlloc(g, NULL, n * sizeof(PVAL));
diff --git a/storage/connect/tabext.cpp b/storage/connect/tabext.cpp
index 139e4199ed9..f2d5eb0e69d 100644
--- a/storage/connect/tabext.cpp
+++ b/storage/connect/tabext.cpp
@@ -125,6 +125,12 @@ EXTDEF::EXTDEF(void)
/***********************************************************************/
bool EXTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
{
+ if (g->Createas) {
+ strcpy(g->Message,
+ "Multiple-table UPDATE/DELETE commands are not supported");
+ return true;
+ } // endif multi
+
Desc = NULL;
Tabname = GetStringCatInfo(g, "Name",
(Catfunc & (FNC_TABLE | FNC_COL)) ? NULL : Name);
diff --git a/storage/connect/tabjdbc.cpp b/storage/connect/tabjdbc.cpp
index 275b5edaeae..adb3fc4fb51 100644
--- a/storage/connect/tabjdbc.cpp
+++ b/storage/connect/tabjdbc.cpp
@@ -1157,8 +1157,9 @@ bool TDBXJDC::OpenDB(PGLOBAL g)
/* Get the command to execute. */
/*********************************************************************/
if (!(Cmdlist = MakeCMD(g))) {
- Jcp->Close();
- return true;
+ // Next lines commented out because of CHECK TABLE
+ //Jcp->Close();
+ //return true;
} // endif Query
Rows = 1;
@@ -1189,8 +1190,10 @@ int TDBXJDC::ReadDB(PGLOBAL g)
Fpos++; // Used for progress info
Cmdlist = (Nerr > Mxr) ? NULL : Cmdlist->Next;
return RC_OK;
- } else
+ } else {
+ PushWarning(g, this, 1);
return RC_EF;
+ } // endif Cmdlist
} // end of ReadDB
diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp
index 605b3822430..ceffafac02c 100644
--- a/storage/connect/tabmysql.cpp
+++ b/storage/connect/tabmysql.cpp
@@ -1587,8 +1587,9 @@ bool TDBMYEXC::OpenDB(PGLOBAL g)
/* Get the command to execute. */
/*********************************************************************/
if (!(Cmdlist = MakeCMD(g))) {
- Myc.Close();
- return true;
+ // Next lines commented out because of CHECK TABLE
+ //Myc.Close();
+ //return true;
} // endif Cmdlist
return false;
@@ -1647,8 +1648,10 @@ int TDBMYEXC::ReadDB(PGLOBAL g)
++N;
return RC_OK;
- } else
- return RC_EF;
+ } else {
+ PushWarning(g, this, 1);
+ return RC_EF;
+ } // endif Cmdlist
} // end of ReadDB
diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp
index f7bc3934fbd..fddfb0c0420 100644
--- a/storage/connect/tabodbc.cpp
+++ b/storage/connect/tabodbc.cpp
@@ -1249,9 +1249,10 @@ bool TDBXDBC::OpenDB(PGLOBAL g)
/* Get the command to execute. */
/*********************************************************************/
if (!(Cmdlist = MakeCMD(g))) {
- Ocp->Close();
- return true;
- } // endif Query
+ // Next lines commented out because of CHECK TABLE
+ //Ocp->Close();
+ //return true;
+ } // endif Cmdlist
Rows = 1;
return false;
@@ -1274,8 +1275,10 @@ int TDBXDBC::ReadDB(PGLOBAL g)
Fpos++; // Used for progress info
Cmdlist = (Nerr > Mxr) ? NULL : Cmdlist->Next;
return RC_OK;
- } else
- return RC_EF;
+ } else {
+ PushWarning(g, this, 1);
+ return RC_EF;
+ } // endif Cmdlist
} // end of ReadDB