mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Adding tests for SQLite3 ODBC Driver
added: mysql-test/suite/connect/r/odbc_sqlite3.result mysql-test/suite/connect/std_data/test.sqlite3 mysql-test/suite/connect/t/odbc_sqlite3.test
This commit is contained in:
parent
bc10400157
commit
ab89a5f51a
3 changed files with 73 additions and 0 deletions
20
mysql-test/suite/connect/r/odbc_sqlite3.result
Normal file
20
mysql-test/suite/connect/r/odbc_sqlite3.result
Normal file
|
@ -0,0 +1,20 @@
|
|||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`Description` varchar(128) NOT NULL,
|
||||
`Attributes` varchar(256) NOT NULL
|
||||
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=ODBC `CATFUNC`=Drivers
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=MYSQL_TEST_DIR/suite/connect/std_data/test.sqlite3;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8;;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(64) DEFAULT NULL
|
||||
) ENGINE=CONNECT DEFAULT CHARSET=utf8 CONNECTION='Driver=SQLite3 ODBC Driver;Database=MYSQL_TEST_DIR/suite/connect/std_data/test.sqlite3;NoWCHAR=yes' `TABLE_TYPE`=ODBC `DATA_CHARSET`=utf8
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
test1
|
||||
test2
|
||||
тест1
|
||||
тест2
|
||||
ÆÇÈÉË
|
||||
DROP TABLE t1;
|
BIN
mysql-test/suite/connect/std_data/test.sqlite3
Normal file
BIN
mysql-test/suite/connect/std_data/test.sqlite3
Normal file
Binary file not shown.
53
mysql-test/suite/connect/t/odbc_sqlite3.test
Normal file
53
mysql-test/suite/connect/t/odbc_sqlite3.test
Normal file
|
@ -0,0 +1,53 @@
|
|||
#
|
||||
# To run this test, install SQLite3 ODBC Driver from
|
||||
# http://www.ch-werner.de/sqliteodbc/
|
||||
# The installer file is sqliteodbc.exe
|
||||
# Version sqliteodbc-0.991 is known to Work.
|
||||
#
|
||||
# On Windows the test should start working automatically
|
||||
#
|
||||
# On Linux add these lines into /etc/odbcinst.ini
|
||||
#
|
||||
#[SQLite3 ODBC Driver]
|
||||
#Description=SQLite ODBC Driver
|
||||
#Driver=/opt/sqliteodbc/libsqlite3odbc.so
|
||||
#Setup=/opt/sqliteodbc/libsqlite3odbc.so
|
||||
#
|
||||
# Note, the test does not need a DSN to be created.
|
||||
#
|
||||
|
||||
--disable_query_log
|
||||
--error 0,ER_UNKNOWN_ERROR
|
||||
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CATFUNC=Drivers;
|
||||
if ($mysql_errno)
|
||||
{
|
||||
Skip No ODBC support;
|
||||
}
|
||||
if (!`SELECT count(*) FROM t1 WHERE Description='SQLite3 ODBC Driver'`)
|
||||
{
|
||||
DROP TABLE t1;
|
||||
Skip Need SQLite3 ODBC Driver;
|
||||
}
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
--enable_query_log
|
||||
|
||||
SET NAMES utf8;
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
let $Database=$MYSQL_TEST_DIR/suite/connect/std_data/test.sqlite3;
|
||||
|
||||
#
|
||||
# For some reasons Windows does not allow to remove the data base
|
||||
# file after "DROP TABLE t1". So unlike in odbc_xls.test we won't copy
|
||||
# the data file, we'll use directly the file in std_data.
|
||||
# As we do not do any modifications in the database, this should be OK.
|
||||
#
|
||||
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
--eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='Driver=SQLite3 ODBC Driver;Database=$Database;NoWCHAR=yes' CHARSET=utf8 DATA_CHARSET=utf8;
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
Loading…
Reference in a new issue