Open fabianofa opened 8 years ago
@fabianofa could you give an example comment which break SQL?
The example is shown on the first image.
The second screenshot is the text written inside the <textarea>
input when an user click to update an issue.
Transcribing the images:
The SQL written while editing:
CREATE TABLE payment_methods (
id INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '',
description VARCHAR(45) NOT NULL COMMENT '',
status TINYINT(1) NULL DEFAULT 1 COMMENT '',
PRIMARY KEY (id) COMMENT ''
);
The SQL how is shown after clicking on save:
CREATE TABLE payment_methods ( id INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT ‘’, description VARCHAR(45) NOT NULL COMMENT ‘’, status TINYINT(1) NULL DEFAULT 1 COMMENT ‘’, PRIMARY KEY (id) COMMENT ‘’ );
Also, may I suggest the syntax highlight lib https://highlightjs.org/ ? It allows users to set a class=
attribute in <code>
tags, such as sql
so the content inside <code class="sql">
would have color highlight.
I now understand what is happening.
copy and paste SQL into some database tool from ticket is not primary concern of candycane. notes of ticket can note detect which text is sql or not.
If a user updates a issue using <code> (some SQL with quotes) </code>, simple quotes will be replaced with curly quotes which if directly pasted to a Database Manager like MySQL Workbench will alert erros for bad syntax.