Commit f69980c6 authored by Olivier Bertrand's avatar Olivier Bertrand

- Fix errors and warnings occuring in --embedded tests

modified:
  storage/connect/connect.cc
  storage/connect/ha_connect.cc
  storage/connect/mysql-test/connect/r/mysql.result
  storage/connect/mysql-test/connect/r/unsigned.result
  storage/connect/mysql-test/connect/t/mysql.test
  storage/connect/mysql-test/connect/t/unsigned.test
parent 57fcf1cb
......@@ -591,7 +591,7 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id)
if (!ptdb)
return -1;
else if (!((PTDBASE)ptdb)->GetDef()->Indexable()) {
sprintf(g->Message, "Table %s is not indexable", ptdb->GetName());
sprintf(g->Message, "CntIndexInit: Table %s is not indexable", ptdb->GetName());
return 0;
} else
tdbp= (PTDBDOX)ptdb;
......@@ -695,7 +695,7 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
if (!ptdb)
return RC_FX;
if (!((PTDBASE)ptdb)->GetDef()->Indexable()) {
sprintf(g->Message, "Table %s is not indexable", ptdb->GetName());
sprintf(g->Message, "CntIndexRead: Table %s is not indexable", ptdb->GetName());
return RC_FX;
} else
tdbp= (PTDBDOX)ptdb;
......@@ -780,7 +780,7 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len,
if (!ptdb)
return -1;
else if (!((PTDBASE)ptdb)->GetDef()->Indexable()) {
sprintf(g->Message, "Table %s is not indexable", ptdb->GetName());
sprintf(g->Message, "CntIndexRange: Table %s is not indexable", ptdb->GetName());
DBUG_PRINT("Range", ("%s", g->Message));
return -1;
} else
......
......@@ -1944,7 +1944,7 @@ int ha_connect::optimize(THD* thd, HA_CHECK_OPT* check_opt)
if (tdbp || (tdbp= GetTDB(g))) {
if (!((PTDBASE)tdbp)->GetDef()->Indexable()) {
sprintf(g->Message, "Table %s is not indexable", tdbp->GetName());
sprintf(g->Message, "optimize: Table %s is not indexable", tdbp->GetName());
rc= HA_ERR_INTERNAL_ERROR;
} else if ((rc= ((PTDBASE)tdbp)->ResetTableOpt(g, true))) {
if (rc == RC_INFO) {
......@@ -3050,7 +3050,7 @@ int ha_connect::external_lock(THD *thd, int lock_type)
if (!tdbp && !(tdbp= GetTDB(g)))
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
else if (!((PTDBASE)tdbp)->GetDef()->Indexable()) {
sprintf(g->Message, "Table %s is not indexable", tdbp->GetName());
sprintf(g->Message, "external_lock: Table %s is not indexable", tdbp->GetName());
// DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);
DBUG_RETURN(0);
......@@ -3168,7 +3168,8 @@ int ha_connect::external_lock(THD *thd, int lock_type)
g->Xchk= new(g) XCHK;
((PCHK)g->Xchk)->oldsep= GetBooleanOption("Sepindex", false);
((PCHK)g->Xchk)->oldpix= GetIndexInfo();
} // endif xcheck
} else
g->Xchk= NULL;
if (cras)
g->Createas= 1; // To tell created table to ignore FLAG
......
......@@ -238,3 +238,38 @@ CREATE TABLE `t2` (
# End of mysqldump ------
DROP TABLE t2;
DROP TABLE t1;
#
# Testing getting unsigned types
#
CREATE TABLE t1 (
a TINYINT UNSIGNED NOT NULL,
b SMALLINT ZEROFILL NOT NULL,
c INT UNSIGNED NOT NULL,
d BIGINT UNSIGNED NOT NULL,
e CHAR(32) NOT NULL DEFAULT 'Hello') ENGINE=CONNECT TABLE_TYPE=FIX;
Warnings:
Warning 1105 No file name. Table will use t1.fix
DESCRIBE t1;
Field Type Null Key Default Extra
a tinyint(3) unsigned NO NULL
b smallint(5) unsigned zerofill NO NULL
c int(10) unsigned NO NULL
d bigint(20) unsigned NO NULL
e char(32) NO Hello
INSERT INTO t1(a,b,c,d) VALUES(255,65535,4294967295,18446744073709551615);
SELECT * FROM t1;
a b c d e
255 65535 4294967295 18446744073709551615 Hello
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME=t1;
DESCRIBE t2;
Field Type Null Key Default Extra
a tinyint(3) unsigned NO NULL
b smallint(5) unsigned zerofill NO NULL
c int(10) unsigned NO NULL
d bigint(20) unsigned NO NULL
e char(32) NO Hello
SELECT * FROM t2;
a b c d e
255 65535 4294967295 18446744073709551615 Hello
DROP TABLE t2;
DROP TABLE t1;
......@@ -58,16 +58,4 @@ SELECT * FROM t2;
a b c d e
255 65535 4294967295 18446744073709551615 18446744073709551615
DROP TABLE t2;
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME=t1;
DESCRIBE t2;
Field Type Null Key Default Extra
a tinyint(3) unsigned NO NULL
b smallint(5) unsigned zerofill NO NULL
c int(10) unsigned NO NULL
d bigint(20) unsigned NO NULL
e char(32) NO ???
SELECT * FROM t2;
a b c d e
255 65535 4294967295 18446744073709551615 18446744073709551615
DROP TABLE t2;
DROP TABLE t1;
......@@ -434,3 +434,23 @@ SELECT * FROM t2;
--echo # End of mysqldump ------
DROP TABLE t2;
DROP TABLE t1;
--echo #
--echo # Testing getting unsigned types
--echo #
CREATE TABLE t1 (
a TINYINT UNSIGNED NOT NULL,
b SMALLINT ZEROFILL NOT NULL,
c INT UNSIGNED NOT NULL,
d BIGINT UNSIGNED NOT NULL,
e CHAR(32) NOT NULL DEFAULT 'Hello') ENGINE=CONNECT TABLE_TYPE=FIX;
DESCRIBE t1;
INSERT INTO t1(a,b,c,d) VALUES(255,65535,4294967295,18446744073709551615);
SELECT * FROM t1;
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME=t1;
DESCRIBE t2;
SELECT * FROM t2;
DROP TABLE t2;
DROP TABLE t1;
......@@ -25,10 +25,11 @@ CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=PROXY TABNAME=t1;
DESCRIBE t2;
SELECT * FROM t2;
DROP TABLE t2;
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME=t1;
DESCRIBE t2;
SELECT * FROM t2;
# Moved to mysql.test (cannot be executed if embedded)
#DROP TABLE t2;
#CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME=t1;
#DESCRIBE t2;
#SELECT * FROM t2;
DROP TABLE t2;
DROP TABLE t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment