Skip to content

Conversation

@terricain
Copy link
Contributor

@terricain terricain commented Jun 14, 2024

Fixes #3443

The copyfrom template generates syntactically incorrect Go when query_parameter_limit is set to 0.

There was a similar bug where by when query_parameter_limit was set to 4 but the number of copyfrom parameters was 2, the struct referenced was not being emitted.

@kyleconroy kyleconroy merged commit e623dc1 into sqlc-dev:main Jun 15, 2024
@terricain terricain deleted the issue_3443_copyfrom branch June 15, 2024 16:03
lisitsky pushed a commit to lisitsky/sqlc that referenced this pull request Jun 21, 2024
* Updated MySQL copyfrom template to handle strucs with 1 argument

* Added copyfrom 1 arg struct testcase

* Fixed issue where copyfrom structs were not being emitted

* Added testcase to catch not emitting structs used with copyfrom
@ysmilda
Copy link

ysmilda commented Jul 24, 2024

Would it be possible to create a new release so we can make use of this fix?

alfonsodev pushed a commit to ExponentiaTeam/sqlc that referenced this pull request Oct 13, 2025
* Updated MySQL copyfrom template to handle strucs with 1 argument

* Added copyfrom 1 arg struct testcase

* Fixed issue where copyfrom structs were not being emitted

* Added testcase to catch not emitting structs used with copyfrom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MySQL copyfrom with query_parameter_limit: 0 generates invalid go code

3 participants