Commit 2f48842a authored by Olivier Bertrand's avatar Olivier Bertrand

Commit merged changes.

parents c1f24461 29cd5363
......@@ -359,3 +359,34 @@ HEX(c) C8CACBCCCD
c ОПРСТ
HEX(c) CECFD0D1D2
DROP TABLE t1;
#
# Testing that the underlying file is created with a proper Encoding
#
CREATE TABLE t1 (node VARCHAR(50))
CHARACTER SET latin1
ENGINE=connect TABLE_TYPE=xml FILE_NAME='t1.xml'
OPTION_LIST='xmlsup=libxml2,rownode=line,encoding=utf-8';
INSERT INTO t1 VALUES (_latin1 0xC0C1C2C3);
SELECT node, hex(node) FROM t1;
node ÀÁÂÃ
hex(node) C0C1C2C3
DROP TABLE t1;
SET @a=LOAD_FILE('test/t1.xml');
SELECT LEFT(@a,38);
LEFT(@a,38) <?xml version="1.0" encoding="utf-8"?>
SELECT HEX(EXTRACTVALUE(@a,'/t1/line/node'));
HEX(EXTRACTVALUE(@a,'/t1/line/node')) C380C381C382C383
CREATE TABLE t1 (node VARCHAR(50))
CHARACTER SET latin1
ENGINE=connect TABLE_TYPE=xml FILE_NAME='t1.xml'
OPTION_LIST='xmlsup=libxml2,rownode=line,encoding=iso-8859-1';
INSERT INTO t1 VALUES (_latin1 0xC0C1C2C3);
SELECT node, hex(node) FROM t1;
node ÀÁÂÃ
hex(node) C0C1C2C3
DROP TABLE t1;
SET @a=LOAD_FILE('test/t1.xml');
SELECT LEFT(@a,43);
LEFT(@a,43) <?xml version="1.0" encoding="iso-8859-1"?>
SELECT HEX(EXTRACTVALUE(@a,'/t1/line/node'));
HEX(EXTRACTVALUE(@a,'/t1/line/node')) C0C1C2C3
......@@ -271,6 +271,36 @@ SELECT c, HEX(c) FROM t1;
DROP TABLE t1;
--echo #
--echo # Testing that the underlying file is created with a proper Encoding
--echo #
CREATE TABLE t1 (node VARCHAR(50))
CHARACTER SET latin1
ENGINE=connect TABLE_TYPE=xml FILE_NAME='t1.xml'
OPTION_LIST='xmlsup=libxml2,rownode=line,encoding=utf-8';
INSERT INTO t1 VALUES (_latin1 0xC0C1C2C3);
SELECT node, hex(node) FROM t1;
DROP TABLE t1;
--chmod 0777 $MYSQLD_DATADIR/test/t1.xml
SET @a=LOAD_FILE('test/t1.xml');
SELECT LEFT(@a,38);
SELECT HEX(EXTRACTVALUE(@a,'/t1/line/node'));
--remove_file $MYSQLD_DATADIR/test/t1.xml
CREATE TABLE t1 (node VARCHAR(50))
CHARACTER SET latin1
ENGINE=connect TABLE_TYPE=xml FILE_NAME='t1.xml'
OPTION_LIST='xmlsup=libxml2,rownode=line,encoding=iso-8859-1';
INSERT INTO t1 VALUES (_latin1 0xC0C1C2C3);
SELECT node, hex(node) FROM t1;
DROP TABLE t1;
--chmod 0777 $MYSQLD_DATADIR/test/t1.xml
SET @a=LOAD_FILE('test/t1.xml');
SELECT LEFT(@a,43);
SELECT HEX(EXTRACTVALUE(@a,'/t1/line/node'));
--remove_file $MYSQLD_DATADIR/test/t1.xml
#
# Clean up
#
......
......@@ -30,7 +30,7 @@ filamzip.cpp tabtbl.cpp myutil.cpp)
#
# Definitions that are shared for all OSes
#
add_definitions( -DMYSQL_DYNAMIC_PLUGIN -DMARIADB -DFORCE_INIT_OF_VARS )
add_definitions( -DMARIADB -DFORCE_INIT_OF_VARS )
add_definitions( -DHUGE_SUPPORT -DZIP_SUPPORT )
......@@ -68,7 +68,7 @@ IF(UNIX)
get_property(inc_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} inihandl.c)
SET(IPHLPAPI_LIBRARY "")
ELSE(!UNIX)
ELSE(NOT UNIX)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabwmi.cpp tabmac.cpp macutil.cpp)
# Add exception handling to the CONNECT project)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
......@@ -160,12 +160,12 @@ IF(CONNECT_WITH_MYSQL)
# For dynamic linking
SET(MYSQL_LIBRARY libmysql)
add_definitions(-DMYSQL_SUPPORT)
IF(!UNIX)
IF(NOT UNIX)
#
# TODO: remove this
# change to use "#include "../../include/mysql.h" in the sources.
INCLUDE_DIRECTORIES("../../include/mysql")
ENDIF(!UNIX)
ENDIF(NOT UNIX)
ENDIF(CONNECT_WITH_MYSQL)
......@@ -222,7 +222,7 @@ IF(CONNECT_WITH_ODBC)
ELSE()
SET(ODBC_LIBRARY "")
ENDIF()
ELSE(!UNIX)
ELSE(NOT UNIX)
add_definitions(-DODBC_SUPPORT)
SET(ODBC_LIBRARY "odbc32.lib odbccp32.lib")
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabodbc.cpp odbconn.cpp)
......
......@@ -3652,7 +3652,6 @@ int ha_connect::create(const char *name, TABLE *table_arg,
TABLE *st= table; // Probably unuseful
PIXDEF xdp, pxd= NULL, toidx= NULL;
PGLOBAL g= GetPlug(table_arg->in_use);
const CHARSET_INFO *data_charset;
DBUG_ENTER("ha_connect::create");
PTOS options= GetTableOptionStruct(table_arg);
......@@ -3662,6 +3661,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
if (options->data_charset)
{
const CHARSET_INFO *data_charset;
if (!(data_charset= get_charset_by_csname(options->data_charset,
MY_CS_PRIMARY, MYF(0))))
{
......@@ -3677,12 +3677,6 @@ int ha_connect::create(const char *name, TABLE *table_arg,
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
}
}
else
{
data_charset= create_info->default_table_charset ?
create_info->default_table_charset :
&my_charset_latin1;
}
if (!g) {
rc= HA_ERR_INTERNAL_ERROR;
......
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