-
-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INSERT fails with a suffix on quoted column name #429
Comments
duckbrain
added a commit
to ec2-software/pop
that referenced
this issue
Aug 26, 2019
Merged
duckbrain
added a commit
to ec2-software/pop
that referenced
this issue
Aug 27, 2019
stanislas-m
pushed a commit
that referenced
this issue
Aug 27, 2019
* Add test to demonstrate INSERT fails with a suffix on quoted column name #429 * Ensure columns are sorted the same way each time.
stanislas-m
pushed a commit
that referenced
this issue
Aug 27, 2019
* Add test to demonstrate INSERT fails with a suffix on quoted column name #429 * Ensure columns are sorted the same way each time.
Fixed with #430. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Pop can now generate column names in a different sorted order when the column names are quoted. This causes inserts not to work or to insert data in the wrong columns.
Steps to Reproduce the Problem
Please describe in painful detail what you did (so others can play along with you) to get to this point. This includes things like the exact command(s) you used, or the
curl
command you used, that sort of thing.database.yml
from Postgres to MySQLMy Specific inputs and outputs:
My struct looks like this:
And the generated
INSERT
looks like this (with whitespace added):Notice that the
XXX_unit
columns are sorted before theirXXX
counterparts in the escaped version, but in reverse for the symbolized column names.Expected Behavior
The columns would be in a consistent order and the query would have worked.
Actual Behavior
The query as described above appeared and it attempted to put a string into a float column.
Info
github.com/gobuffalo/pop v4.11.3+incompatible
Yes, using Pop through Buffalo.
Test case
I was able to produce a test that demonstrates the issue in
columns/columns_test.go
:I also have a simple fix that I will create a PR for.
The text was updated successfully, but these errors were encountered: