Skip to content

Commit 74734a8

Browse files
committed
chore: fix MySQLSyntaxErrorException and unbreak integration tests.
"condition" is a reserved keyword in MySQL and the queries were failing: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO series_sales ( series_id , date , seller_id , transaction_url , first_price , first_currency , second_price , second_currency , buyer_id , condition , created_at , created_by ) VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? )]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition , created_at , created_by ) VALUES ( 9 , '2020-05-22 08:53:59.338' , 1' at line 1 Correction for 28eab06 and 60a690c commits. Thanks to Pavel Finkelshtein <[email protected]> for the hint to use double quotes. Address #1326
1 parent 14eb4c7 commit 74734a8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/resources/sql/series_dao_queries.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ series.find_purchases_and_sales_by_series_id = \
183183
, first_currency \
184184
, second_price \
185185
, second_currency \
186-
, condition \
186+
, "condition" \
187187
FROM series_sales ss \
188188
JOIN transaction_participants seller \
189189
ON seller.id = ss.seller_id \

src/main/resources/sql/series_sales_dao_queries.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ INSERT \
1010
, second_price \
1111
, second_currency \
1212
, buyer_id \
13-
, condition \
13+
, "condition" \
1414
, created_at \
1515
, created_by \
1616
) \

0 commit comments

Comments
 (0)