Skip to content

Commit

Permalink
fix(fuzzer,runner): add quotes around inserted values in DB queries
Browse files Browse the repository at this point in the history
  • Loading branch information
rayanht committed May 2, 2022
1 parent 7b4efcd commit e3e9728
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
20 changes: 10 additions & 10 deletions amber_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ def insert_BQ_entry(
insert_query = f"""
INSERT INTO `spirvsmith.spirv.shader_data`
VALUES (
{shader_id},
"{shader_id}",
{original_entry.shader_rev},
{original_entry.generator_id},
{original_entry.generator_version},
"{original_entry.generator_id}",
"{original_entry.generator_version}",
{original_entry.n_buffers},
{buffer_dump},
{platform_os},
{hardware_type},
{hardware_vendor},
{hardware_model},
{hardware_driver_version},
{backend},
"{buffer_dump}",
"{platform_os}",
"{hardware_type}",
"{hardware_vendor}",
"{hardware_model}",
"{hardware_driver_version}",
"{backend}",
)
"""
delete_query = f"""
Expand Down
9 changes: 5 additions & 4 deletions src/fuzzing_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,20 +192,21 @@ def broadcast_shader_data(generator_id: ULID, shader: SPIRVShader, monitor: Moni
insert_query = f"""
INSERT INTO `spirvsmith.spirv.shader_data`
VALUES (
{shader.id},
"{shader.id}",
1,
{generator_id},
{shader.context.config.misc.version},
"{generator_id}",
"{shader.context.config.misc.version}",
{len(shader.context.get_storage_buffers())},
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
)
"""
print(insert_query)
BQ_client.query(insert_query).result()


Expand Down

0 comments on commit e3e9728

Please sign in to comment.