Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
2f48842a
Commit
2f48842a
authored
Feb 19, 2013
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Plain Diff
Commit merged changes.
parents
c1f24461
29cd5363
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
12 deletions
+67
-12
mysql-test/suite/connect/r/xml.result
mysql-test/suite/connect/r/xml.result
+31
-0
mysql-test/suite/connect/t/xml.test
mysql-test/suite/connect/t/xml.test
+30
-0
storage/connect/CMakeLists.txt
storage/connect/CMakeLists.txt
+5
-5
storage/connect/ha_connect.cc
storage/connect/ha_connect.cc
+1
-7
No files found.
mysql-test/suite/connect/r/xml.result
View file @
2f48842a
...
...
@@ -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
mysql-test/suite/connect/t/xml.test
View file @
2f48842a
...
...
@@ -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
#
...
...
storage/connect/CMakeLists.txt
View file @
2f48842a
...
...
@@ -30,7 +30,7 @@ filamzip.cpp tabtbl.cpp myutil.cpp)
#
# Definitions that are shared for all OSes
#
add_definitions
(
-DM
YSQL_DYNAMIC_PLUGIN -DM
ARIADB -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
)
...
...
storage/connect/ha_connect.cc
View file @
2f48842a
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment