Menu

#4527 (ok 4.2.8) Importing ODS files with column names having trailing spaces fails

4.2.7
fixed
None
1
2015-02-06
2014-08-28
No

When trying to import an ODS (OpenDocument Spreadsheet) file with one or more spaces at the end of one or more column names, the import fails because phpMyAdmin tries to create a table with spaces at the end of the names of the columns of the SQL tables.

Steps to reproduce:
1. Create an ODS with (a) spac(es) trailing the/a column name(s), or use the one attached.
2. Go to the Import page for a database.
3. Check the option Column names in first row.
4. Upload the spreadsheet.

Expected result:
The spreadsheet gets imported into the database correctly.

What I see instead:
phpMyAdmin tries to create a table with spaces at the end of column names, resulting in the following error:

Error

SQL-query:

CREATE TABLE IF NOT EXISTS `world`.`Tab 1` (`At the end of this cell is a space ` int(1), `At the end of this cell there is no space` decimal(4,2), `There is no space at the end of this cell either` int(4)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

MySQL reports:
#1166 - Incorrect column name 'At the end of this cell is a space '

I've tested this both with my local phpMyAdmin 4.1.12 and with the version running at demo.phpmyadmin.net, RELEASE_4_2_7_1-2487-g10c0752.

1 Attachments

Discussion

  • Marc Delisle

    Marc Delisle - 2014-08-29
    • summary: Importing ODS files with column names having trailing spaces fails --> (ok 4.2.8) Importing ODS files with column names having trailing spaces fails
    • status: open --> resolved
    • assigned_to: Marc Delisle
    • Group: 3.3.7 --> 4.2.7
     
  • Marc Delisle

    Marc Delisle - 2014-08-31
    • Status: resolved --> fixed
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.