Fix MDEV-12142 crash when creating CSV table

Was an unprepared longjmp (now throw)
Also fix a wrong calculation of To_Line sometimes causing a crash
because of buffer overflow.
  modified:   storage/connect/tabdos.cpp

Fix a wrong setting of USER for JDBC tables in connect_assisted_discovery.
Update jdbc_new.test after that fix, which changed errors.
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mysql-test/connect/r/jdbc_new.result
  modified:   storage/connect/mysql-test/connect/t/jdbc_new.test

Make using try/catch/throw the default option
  modified:   storage/connect/CMakeLists.txt

Typo
  modified:   storage/connect/xindex.cpp
This commit is contained in:
Olivier Bertrand 2017-03-05 23:54:54 +01:00
parent e52bf14714
commit c4471352db
3 changed files with 3 additions and 7 deletions

View file

@ -38,7 +38,7 @@ user_connect.h valblk.h value.h xindex.h xobject.h xtable.h)
# Definitions that are shared for all OSes
#
add_definitions( -DMARIADB -DFORCE_INIT_OF_VARS -Dconnect_EXPORTS)
add_definitions( -DHUGE_SUPPORT -DGZ_SUPPORT -DPIVOT_SUPPORT )
add_definitions( -DHUGE_SUPPORT -DGZ_SUPPORT -DPIVOT_SUPPORT -DUSE_TRY )
#

View file

@ -14,9 +14,7 @@ NULL NULL
SET GLOBAL time_zone='+1:00';
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC
CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=unknown';
SELECT * FROM t1;
ERROR HY000: Got error 174 'Connecting: java.sql.SQLException: Access denied for user 'unknown'@'localhost' (using password: NO) rc=-2' from CONNECT
DROP TABLE t1;
ERROR HY000: Connecting: java.sql.SQLException: Access denied for user 'unknown'@'localhost' (using password: NO) rc=-2
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC
CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/unknown?user=root';
ERROR HY000: Connecting: java.sql.SQLSyntaxErrorException: Unknown database 'unknown' rc=-2

View file

@ -24,11 +24,9 @@ SET GLOBAL time_zone='+1:00';
# Bad user name
# Suppress "mysql_real_connect failed:" (printed in _DEBUG build)
--replace_result $SLAVE_MYPORT SLAVE_PORT "mysql_real_connect failed: " ""
--error ER_UNKNOWN_ERROR
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC
CONNECTION='jdbc:mysql://127.0.0.1:$SLAVE_MYPORT/test?user=unknown';
--error ER_GET_ERRMSG
SELECT * FROM t1;
DROP TABLE t1;
# Bad database name
--replace_result $SLAVE_MYPORT SLAVE_PORT "mysql_real_connect failed: " ""