Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Database sql export view definition syntax error on commented last line #2050

Copy link
Copy link
Closed
@Jotaro31

Description

@Jotaro31
Issue body actions

Description

Problem:

Exporting a view where the last line of the view definition is line-commented out results in an invalid script.
This is because the delimiter is appended to the last line of the view and ends up uncommented that way.

This mainly affects complete database exports where a syntax error breaks the script execution.

Example:

grafik

grafik

Expected behaviour:

Write valid syntax

Suggested Fix:

Terminate view definition with newline, or trim commented last lines.
Both approaches have the drawback of not replicating the original input perfectly.

Another option would be to throw an exception when editing a view through the GUI without a valid delimiter:
(GUI update log example result from above)

[12:18:41.143] ALTER ALGORITHM = UNDEFINED DEFINER=`root`@`127.0.0.1` SQL SECURITY DEFINER VIEW `export_bad` AS SELECT 'foo'

where true
    -- and false ; ;;

HeidiSQL version

12.8.0.6955

Database server version

MariaDB 10.6.9, possibly any (My)SQL dialect

Reproduction recipe

See example images

Error/Backtrace

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.