Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[tools] generate_tables_sql.php generates broken SQL #9312

Open
maximemulder opened this issue Jul 25, 2024 · 0 comments
Open

[tools] generate_tables_sql.php generates broken SQL #9312

maximemulder opened this issue Jul 25, 2024 · 0 comments
Labels
Bug PR or issue introducing/requiring bug fixes (not mutually exclusive with the Feature label)

Comments

@maximemulder
Copy link
Contributor

Describe the bug

While trying to add an instrument to my dev VM, I encountered a bug in which the SQL generated by generate_tables_sql.php is syntactically broken. I believe this is a regression introduced in #8674, see the results bellow.

Expected output:

CREATE TABLE `SYNHOME_Montreal_Cognitive_Assessment` (
                `CommentID` varchar(255) NOT NULL default '',
                `UserID` varchar(255) default NULL,
                `Examiner` varchar(255) default NULL,
                `Testdate` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Date_taken` date default NULL,
`Candidate_Age` varchar(255) default NULL,
`Window_Difference` varchar(255) default NULL,
PRIMARY KEY  (`CommentID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Actual output:

`SYNHOME_Montreal_Cognitive_Assessment` testname default NULL,
CREATE TABLE `SYNHOME_Montreal_Cognitive_Assessment` (
                `CommentID` varchar(255) NOT NULL default '',
                `UserID` varchar(255) default NULL,
                `Examiner` varchar(255) default NULL,
                `Testdate` timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`Date_taken` date default NULL,
`Candidate_Age` varchar(255) default NULL,
`Window_Difference` varchar(255) default NULL,
PRIMARY KEY  (`CommentID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

The error is obviously in the first line. PR coming soon.

@maximemulder maximemulder added the Bug PR or issue introducing/requiring bug fixes (not mutually exclusive with the Feature label) label Jul 25, 2024
driusan pushed a commit that referenced this issue Aug 12, 2024
Fix syntactically invalid SQL generation.

Fix for #9312.
maximemulder added a commit to maximemulder/Loris that referenced this issue Sep 25, 2024
Fix syntactically invalid SQL generation.

Fix for aces#9312.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug PR or issue introducing/requiring bug fixes (not mutually exclusive with the Feature label)
Projects
None yet
Development

No branches or pull requests

1 participant