Syntax error in SQLite example file (fix included)

Syntax error in SQLite example file (fix included)

pktmpktm Posts: 27Questions: 0Answers: 0

Hi!

The Editor installation instructions contain some database example files here: https://editor.datatables.net/manual/php/installing
The SQLite script is broken, because it contains some syntax errors:

  • line 126 (2 columnsmissing): INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site)
  • should be: INSERT INTO users (title, first_name, last_name, phone, city, zip, registered_date, active, manager, site, shift_start, shift_end)

  • line 289: DROP TABLE IF EXISTS audiobooks CASCADE;
  • should be: DROP TABLE IF EXISTS audiobooks;

  • line 305, 307, and 316 (wrong escape charachter): ( 'Assassin\'s Apprentice: The Farseer Trilogy', 'Robin Hobb', 1043, 5 ),
  • should be doubled single quotes: ( 'Assassin''s Apprentice: The Farseer Trilogy', 'Robin Hobb', 1043, 5 ),

HTH

Replies

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Thanks! I've actually picked this up as well and its fixed for the up coming 1.8.0 release.

    Regards,
    Allan

  • pktmpktm Posts: 27Questions: 0Answers: 0

    Thank you, Allan!

    I also noticed an issue with the timestamp fields. The "without time zone" addition seems not to be supported. I didn't get a warning when running the script, though.

    This is the fix for the lines 55, 56, 57, and 371:

    Before:

    updated_date timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    

    After:

    updated_date timestamp DEFAULT CURRENT_TIMESTAMP,
    

    HTH

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Good point - thanks. Odd that it doesn't fail with an error - it must have an explicit ignore for the postgres style typing on that part somewhere. Either way, fixed for 1.8 - thanks!

    Allan

This discussion has been closed.