[MDEV-15594] Backup and CONNECT Created: 2018-03-17  Updated: 2018-03-28  Resolved: 2018-03-28

Status: Closed
Project: MariaDB Server
Component/s: Backup
Affects Version/s: 10.2.13
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Sergii Volikov Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

backup table "test"
result
CREATE TABLE `test` (
`date` datetime NOT NULL `date_format`='YYYY-MM-DD hh:mm:ss'
) ENGINE=CONNECT DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci `TABLE_TYPE`=CSV `FILE_NAME`='text.csv' `HEADER`=1 `SEP_CHAR`=',' `QUOTED`=1;
restore table error
ERROR 1911 (HY000) at line 8097: Unknown option 'date_format'
Not error
CREATE TABLE `test` (
`date` datetime NOT NULL date_format='YYYY-MM-DD hh:mm:ss'
) ENGINE=CONNECT DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci `TABLE_TYPE`=CSV `FILE_NAME`='text.csv' `HEADER`=1 `SEP_CHAR`=',' `QUOTED`=1;



 Comments   
Comment by Elena Stepanova [ 2018-03-17 ]

What do you mean by backup here? MariaBackup? mysqldump? XtraBackup? Copy-paste of the datadir?

Comment by Sergii Volikov [ 2018-03-19 ]

1. CREATE TABLE test.`test` (
`date` datetime NOT NULL date_format='YYYY-MM-DD hh:mm:ss'
) ENGINE=CONNECT DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci `TABLE_TYPE`=CSV `FILE_NAME`='text.csv' `HEADER`=1 `SEP_CHAR`=',' `QUOTED`=1;
2. mysqldump.exe -u root -p TEST Test
3. Result: CREATE TABLE `test` (
`date` datetime NOT NULL `date_format`='YYYY-MM-DD hh:mm:ss'
) ENGINE=CONNECT DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci `TABLE_TYPE`=CSV `FILE_NAME`='text.csv' `HEADER`=1 `SEP_CHAR`=',' `QUOTED`=1;

if you remove quotes "`" for date_format, then it works without errors

Comment by Alice Sherepa [ 2018-03-28 ]

I tried to reproduce with MariaDB 10.2.13, Ubuntu 16.04., works as expected

MariaDB [test]> CREATE TABLE `t` (
    ->   `date` datetime NOT NULL date_format='YYYY-MM-DD hh:mm:ss'
    -> ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=CSV `FILE_NAME`='/home/alice/Desktop/test.csv' `HEADER`=1 `SEP_CHAR`=',' `QUOTED`=1;
Query OK, 0 rows affected (0.10 sec)
 
MariaDB [test]> select * from t;
+---------------------+
| date                |
+---------------------+
| 2018-03-28 12:36:00 |
| 2018-03-28 12:36:00 |
| 2018-03-28 12:36:00 |
| 2018-03-28 12:36:00 |
+---------------------+
4 rows in set (0.00 sec)
 
MariaDB [test]> show create table t;
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                                                                                               |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t     | CREATE TABLE `t` (
  `date` datetime NOT NULL `date_format`='YYYY-MM-DD hh:mm:ss'
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=CSV `FILE_NAME`='/home/alice/Desktop/test.csv' `HEADER`=1 `SEP_CHAR`=',' `QUOTED`=1 |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

result from mysqldump (the same as from SHOW CREATE TABLE)

-- Table structure for table `t`
--
 
DROP TABLE IF EXISTS `t`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t` (
  `date` datetime NOT NULL `date_format`='YYYY-MM-DD hh:mm:ss'
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=CSV `FILE_NAME`='/home/alice/Desktop/test.csv' `HEADER`=1 `SEP_CHAR`=',' `QUOTED`=1;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

MariaDB [(none)]> create database test1;
Query OK, 1 row affected (0.00 sec)
 
MariaDB [(none)]> use test1;
Database changed
 
MariaDB [test1]> DROP TABLE IF EXISTS `t`;
Query OK, 0 rows affected, 1 warning (0.00 sec)
 
MariaDB [test1]> /*!40101 SET @saved_cs_client     = @@character_set_client */;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test1]> /*!40101 SET character_set_client = utf8 */;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test1]> CREATE TABLE `t` (
    ->   `date` datetime NOT NULL `date_format`='YYYY-MM-DD hh:mm:ss'
    -> ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=CSV `FILE_NAME`='/home/alice/Desktop/test.csv' `HEADER`=1 `SEP_CHAR`=',' `QUOTED`=1;
Query OK, 0 rows affected (0.06 sec)
 
MariaDB [test1]> select * from t;
+---------------------+
| date                |
+---------------------+
| 2018-03-28 12:36:00 |
| 2018-03-28 12:36:00 |
| 2018-03-28 12:36:00 |
| 2018-03-28 12:36:00 |
+---------------------+
4 rows in set (0.00 sec)
 
MariaDB [test1]> select version();
+-----------------+
| version()       |
+-----------------+
| 10.2.13-MariaDB |
+-----------------+
1 row in set (0.00 sec)

Comment by Sergii Volikov [ 2018-03-28 ]

Excuse me.
The CONNECT plugin was not installed.

Comment by Alice Sherepa [ 2018-03-28 ]

It happens)

Generated at Thu Feb 08 08:22:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.