Commit c086a96b authored by Olivier Bertrand's avatar Olivier Bertrand

- Fix an error causing MYSQL table to fail saying "no result set"

  when joining a table to a MYSQL indexed table.
  modified:   storage/connect/myconn.cpp
  modified:   storage/connect/myconn.h
  modified:   storage/connect/tabmysql.cpp

- Fix an error causing JDBC table to fail saying
  when joining a table to a JDBC indexed table.
  added:      storage/connect/tabjdbc.cpp

- Add more tests to the mysql_index.test file
  modified:   storage/connect/mysql-test/connect/r/mysql_index.result
  modified:   storage/connect/mysql-test/connect/t/mysql_index.test

- Add dummy JDBC support (NIY)
  modified:   storage/connect/CMakeLists.txt

- Typo
  modified:   storage/federatedx/ha_federatedx.cc
parent afecdd24
......@@ -257,6 +257,27 @@ int main() {
ENDIF(UNIX)
ENDIF(CONNECT_WITH_ODBC)
#
# JDBC
#
OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine with JDBC support" ON)
IF(CONNECT_WITH_JDBC)
# TODO: detect Java SDK and the presence of JDBC connectors
# Find required libraries and include directories
# Find how to compile and install the JdbcInterface.java class
IF(JDBC_OK)
INCLUDE_DIRECTORIES(${JDBC_INCLUDE_DIR})
add_definitions(-DJDBC_SUPPORT)
SET(CONNECT_SOURCES ${CONNECT_SOURCES}
JdbcInterface.java tabjdbc.cpp jdbconn.cpp jdbccat.h jdbconn.h tabjdbc.h)
ELSE()
SET(JDBC_LIBRARY "")
ENDIF()
ENDIF(CONNECT_WITH_JDBC)
#
# XMAP
......@@ -277,5 +298,5 @@ MYSQL_ADD_PLUGIN(connect ${CONNECT_SOURCES}
COMPONENT connect-engine
RECOMPILE_FOR_EMBEDDED
LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY}
${ODBC_LIBRARY} ${IPHLPAPI_LIBRARY})
${ODBC_LIBRARY} ${JDBC_LIBRARY} ${IPHLPAPI_LIBRARY})
......@@ -959,11 +959,16 @@ void MYSQLC::FreeResult(void)
/***********************************************************************/
/* Place the cursor at the beginning of the result set. */
/***********************************************************************/
void MYSQLC::Rewind(void)
int MYSQLC::Rewind(PGLOBAL g, PSZ sql)
{
int rc = RC_OK;
if (m_Res)
DataSeek(0);
else if (sql)
rc = ExecSQL(g, sql);
return rc;
} // end of Rewind
/***********************************************************************/
......
......@@ -80,7 +80,7 @@ class DllItem MYSQLC {
int Fetch(PGLOBAL g, int pos);
char *GetCharField(int i);
int GetFieldLength(int i);
void Rewind(void);
int Rewind(PGLOBAL g, PSZ sql);
void FreeResult(void);
void Close(void);
......
......@@ -112,3 +112,324 @@ id msg
6 Six
DROP TABLE t2;
DROP TABLE t1;
#
# Make local FIX table with indices matricule and nom/prenom
#
CREATE TABLE t1
(
matricule INT(4) KEY NOT NULL field_format='Z',
nom VARCHAR(16) NOT NULL,
prenom VARCHAR(20) NOT NULL,
sexe SMALLINT(1) NOT NULL COMMENT 'sexe 1:M 2:F',
aanais INT(4) NOT NULL,
mmnais INT(2) NOT NULL,
ddentree DATE NOT NULL date_format='YYYYMM',
ddnom DATE NOT NULL date_format='YYYYMM',
brut INT(5) NOT NULL,
net DOUBLE(8,2) NOT NULL,
service INT(2) NOT NULL,
sitmat CHAR(1) NOT NULL,
formation CHAR(5) NOT NULL,
INDEX NP(nom,prenom)
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='emp.txt' ENDING=2;
#
# Make MYSQL table with same indices
#
CREATE TABLE t2
(
matricule INT(4) KEY NOT NULL,
nom VARCHAR(16) NOT NULL,
prenom VARCHAR(20) NOT NULL,
sexe SMALLINT(1) NOT NULL,
aanais INT(4) NOT NULL,
mmnais INT(2) NOT NULL,
ddentree DATE NOT NULL date_format='YYYYMM',
ddnom DATE NOT NULL date_format='YYYYMM',
brut INT(5) NOT NULL,
net DOUBLE(8,2) NOT NULL,
service INT(2) NOT NULL,
sitmat CHAR(1) NOT NULL,
formation CHAR(5) NOT NULL,
INDEX NP(nom,prenom)
) ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTIOn='mysql://root@localhost/test/t1';
SELECT * FROM t2 limit 10;
matricule nom prenom sexe aanais mmnais ddentree ddnom brut net service sitmat formation
5745 ESCOURCHE BENEDICTE 2 1935 7 1962-12-01 1994-05-01 18345 14275.50 0 M TECHN
9692 VICENTE LAURENCE 2 1941 8 1967-10-01 1989-01-01 16212 13032.80 0 M ANGL
9146 NICOLAS ROGER 1 1941 6 1964-07-01 1995-02-01 34173 25098.65 0 M SANS
2985 TESSEREAU MARIE HELENE 2 1941 9 1967-01-01 1990-01-01 19323 14933.78 0 V SANS
3368 MOGADOR ALAIN 1 1941 1 1961-09-01 1993-11-01 43303 31420.55 0 C SANS
7394 CHAUSSEE ERIC DENIS 1 1944 9 1965-11-01 1983-12-01 32002 23583.86 0 M ANGL
4655 MAILLOT GEORGES 1 1945 5 1970-09-01 1986-12-01 24700 18541.64 0 C ANGL
2825 CAMILLE NADINE 2 1956 9 1994-01-01 1993-01-01 19494 15050.45 0 M SANS
1460 BRUYERES JEAN MARC 1 1958 8 1984-08-01 1988-05-01 20902 15980.07 0 M SANS
4974 LONES GERARD 1 1959 10 1979-01-01 1994-12-01 16081 12916.70 0 M SANS
SELECT matricule, nom, prenom FROM t2 WHERE nom IN ('FOCH','MOGADOR');
matricule nom prenom
1977 FOCH BERNADETTE
5707 FOCH DENIS
2552 FOCH FRANCK
2634 FOCH JOCELYNE
5765 FOCH ROBERT
4080 FOCH SERGE
3368 MOGADOR ALAIN
SELECT matricule, nom, prenom FROM t2 WHERE nom = 'FOCH' OR nom = 'MOGADOR';
matricule nom prenom
1977 FOCH BERNADETTE
5707 FOCH DENIS
2552 FOCH FRANCK
2634 FOCH JOCELYNE
5765 FOCH ROBERT
4080 FOCH SERGE
3368 MOGADOR ALAIN
SELECT matricule, nom, prenom FROM t2 WHERE nom < 'ADDAX';
matricule nom prenom
4552 ABBADIE MONIQUE
307 ABBAYE ANNICK
6627 ABBAYE GERALD
7961 ABBE KATIA
1340 ABBE MICHELE
9270 ABBE SOPHIE
2945 ABBEVILLE PASCAL
8596 ABEBERRY PATRICK
6399 ABEILLES RENE
8673 ABEL JEAN PIERRE
6124 ABELIAS DELIA
6314 ABERDEN EVELYNE
895 ABORD CHANTAL
2728 ABOUT CATHERINE MARIE
398 ABREUVOIR JEAN LUC
1122 ACACIAS SERGE
1644 ACARDIE BEATE
115 ACHILLE JACQUES
4038 ADAM JANICK
3395 ADAM JEAN CLAUDE
SELECT matricule, nom, prenom FROM t2 WHERE nom <= 'ABEL';
matricule nom prenom
4552 ABBADIE MONIQUE
307 ABBAYE ANNICK
6627 ABBAYE GERALD
7961 ABBE KATIA
1340 ABBE MICHELE
9270 ABBE SOPHIE
2945 ABBEVILLE PASCAL
8596 ABEBERRY PATRICK
6399 ABEILLES RENE
8673 ABEL JEAN PIERRE
SELECT matricule, nom, prenom FROM t2 WHERE nom > 'YVON';
matricule nom prenom
9742 YZENGREMER MICHEL
8738 ZILINA JEAN LOUIS
5357 ZOLA BERNARD
5441 ZOLA BRIGITTE
1325 ZOLA CHRISTINE
4859 ZORI CATHERINE
4102 ZOUAVES ALAIN
SELECT matricule, nom, prenom FROM t2 WHERE nom >= 'YVON';
matricule nom prenom
5389 YVON CAROLE
9742 YZENGREMER MICHEL
8738 ZILINA JEAN LOUIS
5357 ZOLA BERNARD
5441 ZOLA BRIGITTE
1325 ZOLA CHRISTINE
4859 ZORI CATHERINE
4102 ZOUAVES ALAIN
SELECT matricule, nom, prenom FROM t2 WHERE nom <= 'ABEL' OR nom > 'YVON';
matricule nom prenom
4552 ABBADIE MONIQUE
307 ABBAYE ANNICK
6627 ABBAYE GERALD
7961 ABBE KATIA
1340 ABBE MICHELE
9270 ABBE SOPHIE
2945 ABBEVILLE PASCAL
8596 ABEBERRY PATRICK
6399 ABEILLES RENE
8673 ABEL JEAN PIERRE
9742 YZENGREMER MICHEL
8738 ZILINA JEAN LOUIS
5357 ZOLA BERNARD
5441 ZOLA BRIGITTE
1325 ZOLA CHRISTINE
4859 ZORI CATHERINE
4102 ZOUAVES ALAIN
SELECT matricule, nom, prenom FROM t2 WHERE nom > 'HELEN' AND nom < 'HEROS';
matricule nom prenom
9096 HELENA PHILIPPE
3309 HELENE ISABELLE
8365 HELIOTROPES LISE
4666 HELLEN PIERRE
5781 HELSINKI DANIELLE
7626 HENIN PHILIPPE
4254 HENIN SERGE
2673 HENNER LILIANE
9716 HENRI JACQUES
2085 HEOL GUY PAUL
2579 HERANDIERE PIERRE
7093 HERAULTS DANIEL
4050 HERBILLON FRANCOIS
9231 HERBILLON MADELEINE
1291 HERMITAGE XAVIER
6185 HERMITTE FRANCOIS
403 HERMITTE PHILIPPE
9749 HEROLD ISABELLE
SELECT matricule, nom, prenom FROM t2 WHERE nom BETWEEN 'HELEN' AND 'HEROS';
matricule nom prenom
6199 HELEN MARTIAL
9096 HELENA PHILIPPE
3309 HELENE ISABELLE
8365 HELIOTROPES LISE
4666 HELLEN PIERRE
5781 HELSINKI DANIELLE
7626 HENIN PHILIPPE
4254 HENIN SERGE
2673 HENNER LILIANE
9716 HENRI JACQUES
2085 HEOL GUY PAUL
2579 HERANDIERE PIERRE
7093 HERAULTS DANIEL
4050 HERBILLON FRANCOIS
9231 HERBILLON MADELEINE
1291 HERMITAGE XAVIER
6185 HERMITTE FRANCOIS
403 HERMITTE PHILIPPE
9749 HEROLD ISABELLE
8445 HEROS SYLVIE
SELECT matricule, nom, prenom FROM t2 WHERE nom BETWEEN 'HELEN' AND 'HEROS' AND prenom = 'PHILIPPE';
matricule nom prenom
9096 HELENA PHILIPPE
7626 HENIN PHILIPPE
403 HERMITTE PHILIPPE
SELECT matricule, nom, prenom FROM t2 ORDER BY nom LIMIT 10;
matricule nom prenom
4552 ABBADIE MONIQUE
6627 ABBAYE GERALD
307 ABBAYE ANNICK
7961 ABBE KATIA
1340 ABBE MICHELE
9270 ABBE SOPHIE
2945 ABBEVILLE PASCAL
8596 ABEBERRY PATRICK
6399 ABEILLES RENE
8673 ABEL JEAN PIERRE
SELECT a.nom, a.prenom, b.nom FROM t1 a STRAIGHT_JOIN t2 b ON a.prenom = b.prenom WHERE a.nom = 'FOCH' AND a.nom != b.nom;
nom prenom nom
FOCH SERGE ACACIAS
FOCH ROBERT AGRIANT
FOCH JOCELYNE ALEXIS
FOCH DENIS AMBOISE
FOCH SERGE ANDALUCIA
FOCH ROBERT ANNECY
FOCH SERGE ARCACHON
FOCH JOCELYNE AUGUSTE
FOCH JOCELYNE BASSE
FOCH SERGE BEACH
FOCH FRANCK BEARN
FOCH SERGE BELLES
FOCH DENIS BERARD
FOCH DENIS BERIN
FOCH BERNADETTE BERTIN
FOCH DENIS BILLEHOU
FOCH DENIS BOILEAU
FOCH BERNADETTE BOISSY
FOCH ROBERT BONVIN
FOCH SERGE BOUTON
FOCH SERGE BREUIL
FOCH SERGE CARREFOUR
FOCH JOCELYNE CARRERE
FOCH JOCELYNE CHAPELLE
FOCH SERGE CHATEAU
FOCH ROBERT CHENIER
FOCH SERGE COLLETTE
FOCH DENIS CONNE
FOCH SERGE COOLE
FOCH DENIS COULOUBRIER
FOCH DENIS COUTURIER
FOCH ROBERT CURAT
FOCH ROBERT DAUDET
FOCH SERGE ECLUSE
FOCH SERGE EGUILLON
FOCH DENIS EPINETTES
FOCH DENIS FIGOURNAS
FOCH JOCELYNE FLEMING
FOCH JOCELYNE GAMBADES
FOCH ROBERT GIOTERAIE
FOCH SERGE GOAS
FOCH ROBERT GRAFFIANE
FOCH SERGE GREFFIER
FOCH ROBERT GUILLOTIERE
FOCH SERGE HENIN
FOCH BERNADETTE HUNTZIGER
FOCH FRANCK ILLIERS
FOCH DENIS ISTANBUL
FOCH DENIS ITALIE
FOCH SERGE JARDIN
FOCH FRANCK JEANPIERRE
FOCH JOCELYNE KENNEDY
FOCH FRANCK LABBE
FOCH DENIS LACATE
FOCH FRANCK LACOMBE
FOCH ROBERT LAMOTHE
FOCH BERNADETTE LATECOERE
FOCH BERNADETTE LEGER
FOCH SERGE LEONIE
FOCH FRANCK LEROY
FOCH SERGE LOZERE
FOCH DENIS MAROLLES
FOCH ROBERT MARRONIERS
FOCH SERGE MARSAT
FOCH SERGE MONTAGNE
FOCH FRANCK MONTALEIGNE
FOCH DENIS MONTELIER
FOCH DENIS MONTILS
FOCH BERNADETTE MONTJUSTIN
FOCH SERGE MORIZET
FOCH ROBERT NIMES
FOCH ROBERT NORD
FOCH SERGE NOVEMBRE
FOCH BERNADETTE ONZE
FOCH SERGE ORANGERIE
FOCH FRANCK ORVEAU
FOCH BERNADETTE PALMAROLE
FOCH JOCELYNE PEYBERT
FOCH ROBERT PEYNIBLOU
FOCH ROBERT PIECE
FOCH JOCELYNE PIED
FOCH ROBERT PLAGNE
FOCH SERGE PLAISANCE
FOCH BERNADETTE PLOUHARNEL
FOCH DENIS POINTE
FOCH ROBERT POMMERY
FOCH JOCELYNE PONTAROUX
FOCH DENIS PORTO
FOCH ROBERT PRESIDENT
FOCH ROBERT PUJADE
FOCH FRANCK PURPAN
FOCH ROBERT QUILICHINI
FOCH DENIS REINOTS
FOCH DENIS REMPART
FOCH SERGE RESISTANCE
FOCH SERGE RESTANQUES
FOCH ROBERT RIOU
FOCH FRANCK ROCQUENCOURT
FOCH ROBERT ROLL
FOCH ROBERT ROSSA
FOCH SERGE ROSSAYS
FOCH DENIS ROUSSIER
FOCH FRANCK RUSSIE
FOCH ROBERT SABLONS
FOCH SERGE SARTRE
FOCH SERGE SAVIGNAC
FOCH SERGE SEGUR
FOCH ROBERT STRASBOURG
FOCH ROBERT TIRE
FOCH DENIS TORTE
FOCH DENIS TOULON
FOCH ROBERT TUBY
FOCH DENIS VALMANTE
FOCH SERGE VANOEL
FOCH ROBERT VIARMES
FOCH SERGE WILSON
DROP TABLE t2;
DROP TABLE t1;
SET NAMES utf8;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='Bad connection string';
ERROR HY000: SQLDriverConnect: [unixODBC][Driver Manager]Data source name not found, and no default driver specified
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CATFUNC=Sources;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`Name` varchar(256) NOT NULL,
`Description` varchar(256) NOT NULL
`Description` varchar(256) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='ODBC' `CATFUNC`='Sources'
SELECT * FROM t1;
Name Description
Firebird Firebird
dBASE Files Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx)
PLUGDB_DEBUG PLUGODBC_Driver
PLUGDB_ODBC PLUGODBC_Driver
SafeDB_ODBC SDB_ODBC_Driver
Firebird Firebird/InterBase(r) driver
ConnectEngineXLS Microsoft Excel Driver (*.xls)
Excel Files Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)
MariaODBC MySQL ODBC 5.2a Driver
MariaODBCbeta MariaDB ODBC 1.0 Driver
MyODBC MySQL ODBC 5.2a Driver
MS Access Database Microsoft Access Driver (*.mdb, *.accdb)
MS Access Db1 Microsoft Access Driver (*.mdb)
MySQL-ANSI MySQL ODBC 5.3 ANSI Driver
MySQL-Unicode MySQL ODBC 5.3 Unicode Driver
Xtreme Sample Database 2008 Microsoft Access Driver (*.mdb)
PlugDB test PLUGODBC_Driver
SQLite3 Datasource SQLite3 ODBC Driver
SQLite Datasource SQLite ODBC Driver
SQLite UTF-8 Datasource SQLite ODBC (UTF-8) Driver
ORACLE_TEST Oracle in XE
ConnectEnginePostgresql PostgreSQL ODBC Driver(ANSI)
ConnectEngineOracle Oracle in XE
ConnectEngineSQLServer SQL Server
DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CATFUNC=Drivers;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`Description` char(128) NOT NULL,
`Attributes` varchar(256) NOT NULL
`Attributes` varchar(256) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='ODBC' `CATFUNC`='Drivers'
SELECT * FROM t1;
Description Attributes
Firebird Description=Firebird ODBC Driver in usr;Driver=/usr/local/lib/libOdbcFb.so;Setup=/usr/local/lib/libOdbcFb.so;FileUsage=1;
SQL Server UsageCount=1;SQLLevel=1;FileUsage=0;DriverODBCVer=03.50;ConnectFunctions=YYY;APILevel=2;CPTimeout=60;
Microsoft ODBC for Oracle UsageCount=1;SQLLevel=1;FileUsage=0;DriverODBCVer=02.50;ConnectFunctions=YYY;APILevel=1;CPTimeout=120;
Microsoft Access Driver (*.mdb) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=2;FileExtns=*.mdb;SQLLevel=0;
Microsoft Access-Treiber (*.mdb) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=2;FileExtns=*.mdb;SQLLevel=0;
Driver do Microsoft Access (*.mdb) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=2;FileExtns=*.mdb;SQLLevel=0;
Microsoft dBase Driver (*.dbf) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.ndx,*.mdx;SQLLevel=0;
Microsoft dBase-Treiber (*.dbf) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.ndx,*.mdx;SQLLevel=0;
Driver do Microsoft dBase (*.dbf) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.ndx,*.mdx;SQLLevel=0;
Microsoft Excel Driver (*.xls) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.xls;SQLLevel=0;
Microsoft Excel-Treiber (*.xls) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.xls;SQLLevel=0;
Driver do Microsoft Excel(*.xls) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.xls;SQLLevel=0;
Microsoft Paradox Driver (*.db ) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.db;SQLLevel=0;
Microsoft Paradox-Treiber (*.db ) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.db;SQLLevel=0;
Driver do Microsoft Paradox (*.db ) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.db;SQLLevel=0;
Microsoft Text Driver (*.txt; *.csv) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.,*.asc,*.csv,*.tab,*.txt,*.csv;SQLLevel=0;
Microsoft Text-Treiber (*.txt; *.csv) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.,*.asc,*.csv,*.tab,*.txt,*.csv;SQLLevel=0;
Driver da Microsoft para arquivos texto (*.txt; *.csv) UsageCount=1;APILevel=1;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.,*.asc,*.csv,*.tab,*.txt,*.csv;SQLLevel=0;
Microsoft Visual FoxPro Driver UsageCount=1;APILevel=0;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.cdx,*.idx,*.fpt;SQLLevel=0;
Microsoft FoxPro VFP Driver (*.dbf) UsageCount=1;APILevel=0;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.cdx,*.idx,*.fpt;SQLLevel=0;
Microsoft dBase VFP Driver (*.dbf) UsageCount=1;APILevel=0;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.cdx,*.idx,*.fpt;SQLLevel=0;
Microsoft Visual FoxPro-Treiber UsageCount=1;APILevel=0;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.cdx,*.idx,*.fpt;SQLLevel=0;
Driver para o Microsoft Visual FoxPro UsageCount=1;APILevel=0;ConnectFunctions=YYN;DriverODBCVer=02.50;FileUsage=1;FileExtns=*.dbf,*.cdx,*.idx,*.fpt;SQLLevel=0;
SQL Native Client UsageCount=1;APILevel=2;ConnectFunctions=YYY;CPTimeout=60;DriverODBCVer=09.00;FileUsage=0;SQLLevel=1;
CR Sybase Wire Protocol ODBC Driver 6.0 UsageCount=1;APILevel=1;ConnectFunctions=YYY;DriverODBCVer=3.52;FileUsage=0;SQLLevel=0;CPTimeout=60;HelpRootDirectory=C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\odbc\help;
CR SQL Server Native Wire Protocol ODBC Driver 6.0 UsageCount=1;APILevel=1;ConnectFunctions=YYY;DriverODBCVer=3.52;FileUsage=0;SQLLevel=1;CPTimeout=60;HelpRootDirectory=C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\odbc\help;
CR SQL Server Classic Wire Protocol ODBC Driver 6.0 UsageCount=1;APILevel=1;ConnectFunctions=YYY;DriverODBCVer=3.52;FileUsage=0;SQLLevel=1;CPTimeout=60;HelpRootDirectory=C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\odbc\help;
CR TextFile ODBC Driver 6.0 UsageCount=1;APILevel=1;ConnectFunctions=YYY;DriverODBCVer=3.52;FileUsage=1;FileExtns=*.*;SQLLevel=0;CPTimeout=60;HelpRootDirectory=C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\odbc\help;
PLUGODBC_Driver UsageCount=1;
SDB_ODBC_Driver UsageCount=2;
Microsoft Access Text Driver (*.txt, *.csv) SQLLevel=0;FileExtns=*.txt, *.csv;FileUsage=2;DriverODBCVer=02.50;ConnectFunctions=YYN;APILevel=1;UsageCount=3;
Microsoft Access dBASE Driver (*.dbf, *.ndx, *.mdx) SQLLevel=0;FileExtns=*.dbf, *.ndx, *.mdx;FileUsage=2;DriverODBCVer=02.50;ConnectFunctions=YYN;APILevel=1;UsageCount=3;
Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb) SQLLevel=0;FileExtns=*.xls,*.xlsx, *.xlsb;FileUsage=2;DriverODBCVer=02.50;ConnectFunctions=YYN;APILevel=1;UsageCount=3;
Microsoft Access Driver (*.mdb, *.accdb) SQLLevel=0;FileExtns=*.mdb,*.accdb;FileUsage=2;DriverODBCVer=02.50;ConnectFunctions=YYN;APILevel=1;UsageCount=3;
SQLite3 ODBC Driver UsageCount=1;
SQLite ODBC Driver UsageCount=1;
SQLite ODBC (UTF-8) Driver UsageCount=1;
Oracle in XE ConnectionFunctions=YYY;DriverODBCVer=03.51;CPTimeout=60;FileUsage=0;APILevel=1;SQLLevel=1;
Oracle in instantclient_12_1 APILevel=1;ConnectionFunctions=YYY;CPTimeout=60;DriverODBCVer=03.51;FileUsage=0;SQLLevel=1;
PostgreSQL ODBC Driver(ANSI) APILevel=1;ConnectFunctions=YYN;DriverODBCVer=09.02.0100;FileUsage=0;SQLLevel=1;
PostgreSQL ODBC Driver(UNICODE) APILevel=1;ConnectFunctions=YYN;DriverODBCVer=09.02.0100;FileUsage=0;SQLLevel=1;
SQL Server Native Client 11.0 UsageCount=1;APILevel=2;ConnectFunctions=YYY;CPTimeout=60;DriverODBCVer=03.80;FileUsage=0;SQLLevel=1;
MariaDB ODBC 1.0 Driver UsageCount=1;
Firebird/InterBase(r) driver UsageCount=1;FileExtns=*.fdb,*.gdb;APILevel=1;ConnectFunctions=YYY;FileUsage=0;DriverODBCVer=03.51;SQLLevel=1;
MySQL ODBC 5.3 ANSI Driver UsageCount=1;
MySQL ODBC 5.3 Unicode Driver UsageCount=1;
DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CATFUNC=Tables CONNECTION='Not important';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`Table_Cat` char(128) NOT NULL,
`Table_Schema` char(128) NOT NULL,
`Table_Cat` char(128) DEFAULT NULL,
`Table_Schema` char(128) DEFAULT NULL,
`Table_Name` char(128) NOT NULL,
`Table_Type` char(16) NOT NULL,
`Remark` char(255) NOT NULL
`Remark` char(255) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='Not important' `TABLE_TYPE`='ODBC' `CATFUNC`='Tables'
DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CATFUNC=Columns CONNECTION='Not important';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`Table_Cat` char(128) NOT NULL,
`Table_Schema` char(128) NOT NULL,
`Table_Cat` char(128) DEFAULT NULL,
`Table_Schema` char(128) DEFAULT NULL,
`Table_Name` char(128) NOT NULL,
`Column_Name` char(128) NOT NULL,
`Data_Type` smallint(6) NOT NULL,
`Type_Name` char(30) NOT NULL,
`Column_Size` int(10) NOT NULL,
`Buffer_Length` int(10) NOT NULL,
`Decimal_Digits` smallint(6) NOT NULL,
`Radix` smallint(6) NOT NULL,
`Decimal_Digits` smallint(6) DEFAULT NULL,
`Radix` smallint(6) DEFAULT NULL,
`Nullable` smallint(6) NOT NULL,
`Remarks` char(255) NOT NULL
`Remarks` char(255) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='Not important' `TABLE_TYPE`='ODBC' `CATFUNC`='Columns'
DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC TABNAME='EMPLOYEE' CONNECTION='DSN=Firebird;UID=SYSDBA;PWD=manager';
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC TABNAME='EMPLOYEE' CONNECTION='DSN=Firebird;UID=SYSDBA;PWD=masterkey';
SELECT * FROM t1;
EMP_NO FIRST_NAME LAST_NAME PHONE_EXT HIRE_DATE DEPT_NO JOB_CODE JOB_GRADE JOB_COUNTRY SALARY FULL_NAME
2 Robert Nelson 250 1988-12-28 00:00:00 600 VP 2 USA 105900.00 Nelson, Robert
......
......@@ -64,3 +64,70 @@ SELECT * FROM t2;
DROP TABLE t2;
DROP TABLE t1;
let $MYSQLD_DATADIR= `select @@datadir`;
--copy_file $MTR_SUITE_DIR/std_data/emp.txt $MYSQLD_DATADIR/test/emp.txt
--echo #
--echo # Make local FIX table with indices matricule and nom/prenom
--echo #
CREATE TABLE t1
(
matricule INT(4) KEY NOT NULL field_format='Z',
nom VARCHAR(16) NOT NULL,
prenom VARCHAR(20) NOT NULL,
sexe SMALLINT(1) NOT NULL COMMENT 'sexe 1:M 2:F',
aanais INT(4) NOT NULL,
mmnais INT(2) NOT NULL,
ddentree DATE NOT NULL date_format='YYYYMM',
ddnom DATE NOT NULL date_format='YYYYMM',
brut INT(5) NOT NULL,
net DOUBLE(8,2) NOT NULL,
service INT(2) NOT NULL,
sitmat CHAR(1) NOT NULL,
formation CHAR(5) NOT NULL,
INDEX NP(nom,prenom)
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='emp.txt' ENDING=2;
--echo #
--echo # Make MYSQL table with same indices
--echo #
CREATE TABLE t2
(
matricule INT(4) KEY NOT NULL,
nom VARCHAR(16) NOT NULL,
prenom VARCHAR(20) NOT NULL,
sexe SMALLINT(1) NOT NULL,
aanais INT(4) NOT NULL,
mmnais INT(2) NOT NULL,
ddentree DATE NOT NULL date_format='YYYYMM',
ddnom DATE NOT NULL date_format='YYYYMM',
brut INT(5) NOT NULL,
net DOUBLE(8,2) NOT NULL,
service INT(2) NOT NULL,
sitmat CHAR(1) NOT NULL,
formation CHAR(5) NOT NULL,
INDEX NP(nom,prenom)
) ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTIOn='mysql://root@localhost/test/t1';
SELECT * FROM t2 limit 10;
SELECT matricule, nom, prenom FROM t2 WHERE nom IN ('FOCH','MOGADOR');
SELECT matricule, nom, prenom FROM t2 WHERE nom = 'FOCH' OR nom = 'MOGADOR';
SELECT matricule, nom, prenom FROM t2 WHERE nom < 'ADDAX';
SELECT matricule, nom, prenom FROM t2 WHERE nom <= 'ABEL';
SELECT matricule, nom, prenom FROM t2 WHERE nom > 'YVON';
SELECT matricule, nom, prenom FROM t2 WHERE nom >= 'YVON';
SELECT matricule, nom, prenom FROM t2 WHERE nom <= 'ABEL' OR nom > 'YVON';
SELECT matricule, nom, prenom FROM t2 WHERE nom > 'HELEN' AND nom < 'HEROS';
SELECT matricule, nom, prenom FROM t2 WHERE nom BETWEEN 'HELEN' AND 'HEROS';
SELECT matricule, nom, prenom FROM t2 WHERE nom BETWEEN 'HELEN' AND 'HEROS' AND prenom = 'PHILIPPE';
SELECT matricule, nom, prenom FROM t2 ORDER BY nom LIMIT 10;
SELECT a.nom, a.prenom, b.nom FROM t1 a STRAIGHT_JOIN t2 b ON a.prenom = b.prenom WHERE a.nom = 'FOCH' AND a.nom != b.nom;
DROP TABLE t2;
DROP TABLE t1;
#
# Clean up
#
--remove_file $MYSQLD_DATADIR/test/emp.txt
--remove_file $MYSQLD_DATADIR/test/emp.fnx
......@@ -4,7 +4,7 @@ SET NAMES utf8;
# MS ODBC and unixODBC return different error message text,
# so disable displaying error messages
#--disable_result_log ONCE
--disable_result_log ONCE
--error ER_UNKNOWN_ERROR
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='Bad connection string';
......@@ -26,6 +26,6 @@ CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CATFUNC=Columns CONNECTION='Not i
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC TABNAME='EMPLOYEE' CONNECTION='DSN=Firebird;UID=SYSDBA;PWD=manager';
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC TABNAME='EMPLOYEE' CONNECTION='DSN=Firebird;UID=SYSDBA;PWD=masterkey';
SELECT * FROM t1;
DROP TABLE t1;
......@@ -756,7 +756,8 @@ bool TDBJDBC::OpenDB(PGLOBAL g)
if (Memory < 3) {
// Method will depend on cursor type
if (Mode != MODE_READX && (Rbuf = Jcp->Rewind(Query->GetStr())) < 0) {
if ((Rbuf = Jcp->Rewind(Query->GetStr())) < 0)
if (Mode != MODE_READX) {
Jcp->Close();
return true;
} else
......
......@@ -857,7 +857,9 @@ bool TDBMYSQL::OpenDB(PGLOBAL g)
/*******************************************************************/
/* Table already open, just replace it at its beginning. */
/*******************************************************************/
Myc.Rewind();
if (Myc.Rewind(g, (Mode == MODE_READX) ? Query->GetStr() : NULL) != RC_OK)
return true;
N = -1;
return false;
} // endif use
......
......@@ -1319,7 +1319,7 @@ bool ha_federatedx::create_where_from_key(String *to,
break;
}
DBUG_PRINT("info", ("federatedx HA_READ_AFTER_KEY %d", i));
if (store_length >= length) /* end key */
if (store_length >= length || i > 0) /* end key */
{
if (emit_key_part_name(&tmp, key_part))
goto err;
......
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