~maria-captains/maria/10.0

« back to all changes in this revision

Viewing changes to storage/connect/mysql-test/connect/t/dbf.test

  • Committer: Olivier Bertrand
  • Date: 2014-02-03 15:14:13 UTC
  • mto: This revision was merged to the branch mainline in revision 3984.
  • Revision ID: bertrandop@gmail.com-20140203151413-ps3oglvhb4lksxxy
This is a major update of CONNECT that goes from version 1.1 to 1.2
===================================================================
- Implement a first support of the ALTER TABLE command. This fixes MDEV-5440
  but does much more than only that. See the details of how ALTER is supported
  in the new documentation and also in MDEV-5440 comment.
  This is done principally by implementing for CONNECT the virtual function
  check_if_supported_inplace_alter.
modified:
  storage/connect/connect.cc
  storage/connect/global.h
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/mysql-test/connect/r/bin.result
  storage/connect/mysql-test/connect/r/csv.result
  storage/connect/mysql-test/connect/r/dbf.result
  storage/connect/mysql-test/connect/r/dir.result
  storage/connect/mysql-test/connect/r/fix.result
  storage/connect/mysql-test/connect/r/index.result
  storage/connect/mysql-test/connect/r/ini.result
  storage/connect/mysql-test/connect/r/occur.result
  storage/connect/mysql-test/connect/r/pivot.result
  storage/connect/mysql-test/connect/r/vec.result
  storage/connect/mysql-test/connect/t/dbf.test
  storage/connect/plugutil.c
  storage/connect/user_connect.cc

- Fixes the tabname/table_name issue for XML tables. Implement
  multiple files XML tables.
modified:
  storage/connect/tabxml.cpp
  storage/connect/tabxml.h

- Set to varchar(256) the fields of catalog tables stored
  as STRBLK's (had length 0 --> CHAR(1))
  Add the GetCharString function to the VALBLK class
modified:
  storage/connect/ha_connect.cc
  storage/connect/valblk.cpp
  storage/connect/valblk.h
  storage/connect/value.cpp

- Translate CONNECT error messages to system_charset
  to avoid truncation on not ASCII characters.
modified:
  storage/connect/ha_connect.cc

- Update version number
modified:
  storage/connect/ha_connect.cc
  storage/connect/mysql-test/connect/r/xml.result

- Move the TDBASE::data_charset body from xtable.h to table.cpp.
  (dont' remember why)
modified:
  storage/connect/table.cpp
  storage/connect/xtable.h

- Other modifications are to enhance the support of OEM tables.
  In particular, they can now provide column definition in dicovery.
modified:
  storage/connect/colblk.h
  storage/connect/global.h
  storage/connect/ha_connect.cc
  storage/connect/mycat.cc
  storage/connect/plgcnx.h
  storage/connect/plgdbsem.h
  storage/connect/xtable.h

- Or to add or modify tracing.
modified:
  storage/connect/filamtxt.cpp
  storage/connect/ha_connect.cc
  storage/connect/plgdbutl.cpp
  storage/connect/tabfix.cpp
  storage/connect/tabmysql.cpp

Show diffs side-by-side

added added

removed removed

Lines of Context:
442
442
--echo #
443
443
--echo # Testing ALTER
444
444
--echo #
 
445
# Temporarily change the file name because ALTER that are not executed not in place
 
446
# delete the data file when it has the same path/name than the default file name.
445
447
CREATE TABLE t1
446
448
(
447
449
  a VARCHAR(10) NOT NULL
448
 
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
 
450
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1c.dbf';
449
451
INSERT INTO t1 VALUES ('10');
450
452
SELECT * FROM t1;
451
 
--chmod 0777 $MYSQLD_DATADIR/test/t1.dbf
 
453
--chmod 0777 $MYSQLD_DATADIR/test/t1c.dbf
452
454
--vertical_results
453
455
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
454
 
eval CALL dbf_header('$MYSQLD_DATADIR/test/t1.dbf');
 
456
eval CALL dbf_header('$MYSQLD_DATADIR/test/t1c.dbf');
455
457
--horizontal_results
456
458
ALTER TABLE t1 MODIFY a VARCHAR(10) NOT NULL;
457
459
SHOW CREATE TABLE t1;
458
460
SELECT * FROM t1;
459
461
--vertical_results
460
462
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
461
 
eval CALL dbf_header('$MYSQLD_DATADIR/test/t1.dbf');
 
463
eval CALL dbf_header('$MYSQLD_DATADIR/test/t1c.dbf');
462
464
--horizontal_results
463
465
ALTER TABLE t1 MODIFY a INT(10) NOT NULL;
464
466
SHOW CREATE TABLE t1;
465
467
SELECT * FROM t1;
466
468
--vertical_results
467
469
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
468
 
eval CALL dbf_header('$MYSQLD_DATADIR/test/t1.dbf');
 
470
eval CALL dbf_header('$MYSQLD_DATADIR/test/t1c.dbf');
469
471
--horizontal_results
470
472
 
471
473
# TODO: this does not work on Windows
478
480
#eval CALL dbf_header('$MYSQLD_DATADIR/test/t1.dbf');
479
481
#--horizontal_results
480
482
DROP TABLE IF EXISTS t1;
481
 
--remove_file $MYSQLD_DATADIR/test/t1.dbf
 
483
--remove_file $MYSQLD_DATADIR/test/t1c.dbf
482
484
 
483
485
 
484
486
--echo #