Skip to content

Commit 2ef520f

Browse files
committed
Fixed Incorrect arguments to mysqld_stmt_execute
This error appears to only happen on CI and not locally, despite everything running with the same version. I have no idea why this is the case. Since I removed the `nil` from the prepared statement, it is possible that this problem is related to the issues linked below, but I'm not sure. I also don't really know how to debug in github actions yet, so I don't know how to confirm if this is indeed the case. - go-sql-driver/mysql#209 - launchbadge/sqlx#125 - https://stackoverflow.com/questions/16726752/sending-null-in-a-prepared-statement-for-mysql-doesnt-seem-to-work?rq=1
1 parent 736aa9e commit 2ef520f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/helpers/db_helper.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ def seed_random_data(connection, database_name: DEFAULT_DB, table_name: DEFAULT_
125125
return if number_of_rows == 0
126126

127127
transaction(connection) do
128-
sqlargs = (["(?,?)"]*number_of_rows).join(", ")
129-
sql = "INSERT INTO #{dbtable} (id, data) VALUES #{sqlargs}"
128+
sqlargs = (["(?)"]*number_of_rows).join(", ")
129+
sql = "INSERT INTO #{dbtable} (data) VALUES #{sqlargs}"
130130
insert_statement = connection.prepare(sql)
131131

132132
rand_rows = []
133133
number_of_rows.times do
134-
rand_rows += [nil, rand_data]
134+
rand_rows += [rand_data]
135135
end
136136

137137
insert_statement.execute(*rand_rows)

0 commit comments

Comments
 (0)