[MDEV-26397] VBS to Import a CSV file Created: 2021-08-18  Updated: 2021-10-26  Resolved: 2021-10-25

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.6.4
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Paul Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: CSV, need_feedback

Attachments: File actions.sql     Microsoft Word testactions.csv     File testactions1.vbs    

 Description   

Hello.
I am in a test between MySQL and Maria DB, but I have a VBS file that imports a CSV file into the database. In the MySQL it works fin, but when I try it in Maria DB it will not import. The testactions1.vbs is the script, and all I have done is change the path for the mysqlimport. actions.sql is the table I am importing to. But I just cant seem to put my finger on the issue. As it is being done by a script, I cant find a log to see what the error is, if anybody can help me please?
Thank you



 Comments   
Comment by Sergei Golubchik [ 2021-08-23 ]

you can add some prints or replace mysqlimport with a wrapper to see the exact command that you're running.
you can enable general log on the server to see what commands exactly the server is receiving.

Comment by Sergei Golubchik [ 2021-08-23 ]

what mariadb version is it?

Comment by Paul [ 2021-08-23 ]

Hi. I am using Server version: 10.6.4-MariaDB - mariadb.org binary distribution.
From a few experiments, I found that if I import my complete SQL database from MySQL 5.7 into MariaDB, it makes the actions table and fills it up. Then using my VBS script, an import fails.
If I then delete the actions table and using MySQL workbench, I import a CSV file, it creates the actions table, with one row of data. After that the VBS will also import.
I need to do more research to see why this happens
Regards
Paul

Comment by Sergei Golubchik [ 2021-10-25 ]

How exactly does it fail? Do you get an error? What error is it?

Comment by Paul [ 2021-10-25 ]

I dont know, the CSV just does not import when using the VBS script.
I had the same error on MySQL 8, its only MySQL 5+ that it works on, so I think it is a security issue

Comment by Sergei Golubchik [ 2021-10-25 ]

Likely not security as such, but data conversion. Like inserting 5 characters into CHAR(4) or an invalid date, like, 2021-10-00 or an emoji into a utf8mb3 column.

Depending on how strict the database is it could be a warning or an error. Strictness was changed over time in different MySQL and MariaDB versions. See also https://mariadb.com/kb/en/mariadb/sql_mode/

Comment by Paul [ 2021-10-26 ]

OK so what I do is export a full database from MySQL using PHPMyAdmin, and then I go into the MariaDB and make a database called new_db_2005. I then go to the command line and enter my password and use, source new_db_2005 and use C:\new_db_2005.sql
This then imports all the data, same size fields so I do not have 5 characters into CHAR(4).

Generated at Thu Feb 08 09:45:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.