Index: lnt/server/db/migrations/upgrade_11_to_12.py =================================================================== --- lnt/server/db/migrations/upgrade_11_to_12.py +++ lnt/server/db/migrations/upgrade_11_to_12.py @@ -21,7 +21,7 @@ name = info.pop('name', None) if name is not None: info['hostname'] = name - machine.Parameters = json.dumps(sorted(info.items())) + machine.Parameters = json.dumps(sorted(info.items())).encode("utf-8") session.commit() session.close() Index: lnt/server/db/migrations/upgrade_1_to_2.py =================================================================== --- lnt/server/db/migrations/upgrade_1_to_2.py +++ lnt/server/db/migrations/upgrade_1_to_2.py @@ -84,7 +84,7 @@ # Update the run info. run_info['inferred_run_order'] = run_order run_info['__report_version__'] = '1' - run.Parameters = json.dumps(sorted(run_info.items())) + run.Parameters = json.dumps(sorted(run_info.items())).encode('utf-8') if run_order != orig_order: # Lookup the new run order. Index: lnt/server/db/testsuite.py =================================================================== --- lnt/server/db/testsuite.py +++ lnt/server/db/testsuite.py @@ -106,7 +106,7 @@ def __init__(self, testsuite_name, data): self.testsuite_name = testsuite_name - self.jsonschema = json.dumps(data, encoding='utf-8', sort_keys=True) + self.jsonschema = json.dumps(data, sort_keys=True).encode('utf-8') class TestSuite(Base): Index: lnt/server/db/testsuitedb.py =================================================================== --- lnt/server/db/testsuitedb.py +++ lnt/server/db/testsuitedb.py @@ -143,7 +143,7 @@ @parameters.setter def parameters(self, data): - self.parameters_data = json.dumps(sorted(data.items())) + self.parameters_data = json.dumps(sorted(data.items())).encode("utf-8") def get_baseline_run(self, session): ts = Machine.testsuite @@ -393,7 +393,7 @@ @parameters.setter def parameters(self, data): - self.parameters_data = json.dumps(sorted(data.items())) + self.parameters_data = json.dumps(sorted(data.items())).encode("utf-8") def __json__(self, flatten_order=True): result = { Index: tests/SharedInputs/SmallInstance/data/lnt_db_create.sql =================================================================== --- tests/SharedInputs/SmallInstance/data/lnt_db_create.sql +++ tests/SharedInputs/SmallInstance/data/lnt_db_create.sql @@ -153,7 +153,7 @@ ); INSERT INTO "NT_Machine" ("Name", "Parameters", "hardware", "os") VALUES('localhost__clang_DEV__x86_64', - '[["name", "localhost"], ["uname", "Darwin localhost 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64"]]', + CAST('[["name", "localhost"], ["uname", "Darwin localhost 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64"]]' AS BLOB), 'x86_64','Darwin 11.3.0'); -- ID 1 CREATE TABLE "NT_Test" ( "ID" INTEGER PRIMARY KEY NOT NULL, Index: tests/server/db/Inputs/V4Pages_extra_records.sql =================================================================== --- tests/server/db/Inputs/V4Pages_extra_records.sql +++ tests/server/db/Inputs/V4Pages_extra_records.sql @@ -6,27 +6,27 @@ -- make sure there are 3 machines - to test ?filter-machine-regex= on daily_report page INSERT INTO "NT_Machine" ("Name", "Parameters", "hardware", "os") - VALUES('machine2','[]','AArch64','linux'); -- ID 2 + VALUES('machine2',CAST('[]' AS BLOB),'AArch64','linux'); -- ID 2 INSERT INTO "NT_Order" ("NextOrder", "PreviousOrder", "llvm_project_revision") VALUES(2,NULL,'152290'); -- ID 3 UPDATE "NT_Order" SET "NextOrder" = 3 WHERE "ID" = 2; INSERT INTO "NT_Run" ("MachineID", "OrderID", "ImportedFrom", "StartTime", "EndTime", "SimpleRunID", "Parameters") VALUES(2,3,'run3.json','2012-04-11 16:28:23.000000', - '2012-04-11 16:28:58.000000',NULL,'[]'); -- ID 3 + '2012-04-11 16:28:58.000000',NULL,CAST('[]' AS BLOB)); -- ID 3 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes") VALUES(3,1,NULL,NULL,0.001,0.0001,NULL,NULL); -- ID 3 INSERT INTO "NT_Machine" ("Name", "Parameters", "hardware", "os") - VALUES('machine3','[]','AArch64','linux'); -- ID 3 + VALUES('machine3',CAST('[]' AS BLOB),'AArch64','linux'); -- ID 3 INSERT INTO "NT_Order" ("NextOrder", "PreviousOrder", "llvm_project_revision") VALUES(3,NULL,'152291'); -- ID 4 UPDATE "NT_Order" SET "PreviousOrder" = 4 WHERE "ID" = 3; INSERT INTO "NT_Run" ("MachineID", "OrderID", "ImportedFrom", "StartTime", "EndTime", "SimpleRunID", "Parameters") VALUES(3,4,'run4.json','2012-04-11 16:28:24.000000', - '2012-04-11 16:28:59.000000',NULL,'[]'); -- ID 4 + '2012-04-11 16:28:59.000000',NULL,CAST('[]' AS BLOB)); -- ID 4 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes") @@ -40,7 +40,7 @@ INSERT INTO "NT_Run" ("MachineID", "OrderID", "ImportedFrom", "StartTime", "EndTime", "SimpleRunID", "Parameters") VALUES(2,5,'run5.json','2012-05-01 16:28:23.000000', - '2012-05-01 16:28:58.000000',NULL,'[]'); -- ID 5 + '2012-05-01 16:28:58.000000',NULL,CAST('[]' AS BLOB)); -- ID 5 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes") @@ -55,7 +55,7 @@ INSERT INTO "NT_Run" ("MachineID", "OrderID", "ImportedFrom", "StartTime", "EndTime", "SimpleRunID", "Parameters") VALUES(2,6,'run6.json','2012-05-03 16:28:24.000000', - '2012-05-03 16:28:59.000000',NULL,'[]'); -- ID 6 + '2012-05-03 16:28:59.000000',NULL,CAST('[]' AS BLOB)); -- ID 6 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes") @@ -76,15 +76,15 @@ INSERT INTO "NT_Run" ("MachineID", "OrderID", "ImportedFrom", "StartTime", "EndTime", "SimpleRunID", "Parameters") VALUES(2,6,'run7.json','2012-05-10 16:28:23.000000', - '2012-05-10 16:28:58.000000',NULL,'[]'); -- ID 7 + '2012-05-10 16:28:58.000000',NULL,CAST('[]' AS BLOB)); -- ID 7 INSERT INTO "NT_Run" ("MachineID", "OrderID", "ImportedFrom", "StartTime", "EndTime", "SimpleRunID", "Parameters") VALUES(2,7,'run8.json','2012-05-11 16:28:23.000000', - '2012-05-11 16:28:58.000000',NULL,'[]'); -- ID 8 + '2012-05-11 16:28:58.000000',NULL,CAST('[]' AS BLOB)); -- ID 8 INSERT INTO "NT_Run" ("MachineID", "OrderID", "ImportedFrom", "StartTime", "EndTime", "SimpleRunID", "Parameters") VALUES(2,8,'run9.json','2012-05-12 16:28:23.000000', - '2012-05-12 16:28:58.000000',NULL,'[]'); -- ID 9 + '2012-05-12 16:28:58.000000',NULL,CAST('[]' AS BLOB)); -- ID 9 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes") Index: tests/server/ui/Inputs/V4Pages_extra_records.sql =================================================================== --- tests/server/ui/Inputs/V4Pages_extra_records.sql +++ tests/server/ui/Inputs/V4Pages_extra_records.sql @@ -6,27 +6,27 @@ -- make sure there are 3 machines - to test ?filter-machine-regex= on daily_report page INSERT INTO "NT_Machine" ("Name", "Parameters", "hardware", "os") - VALUES('machine2','[]','AArch64','linux'); -- ID 2 + VALUES('machine2',CAST('[]' AS BLOB),'AArch64','linux'); -- ID 2 INSERT INTO "NT_Order" ("NextOrder", "PreviousOrder", "llvm_project_revision") VALUES(2,NULL,'152290'); -- ID 3 UPDATE "NT_Order" SET "NextOrder" = 3 WHERE "ID" = 2; INSERT INTO "NT_Run" ("MachineID", "OrderID", "ImportedFrom", "StartTime", "EndTime", "SimpleRunID", "Parameters") VALUES(2,3,'run3.json','2012-04-11 16:28:23.000000', - '2012-04-11 16:28:58.000000',NULL,'[]'); -- ID 3 + '2012-04-11 16:28:58.000000',NULL,CAST('[]' AS BLOB)); -- ID 3 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes") VALUES(3,1,NULL,NULL,0.001,0.0001,NULL,NULL); -- ID 3 INSERT INTO "NT_Machine" ("Name", "Parameters", "hardware", "os") - VALUES('machine3','[]','AArch64','linux'); -- ID 3 + VALUES('machine3',CAST('[]' AS BLOB),'AArch64','linux'); -- ID 3 INSERT INTO "NT_Order" ("NextOrder", "PreviousOrder", "llvm_project_revision") VALUES(3,NULL,'152291'); -- ID 4 UPDATE "NT_Order" SET "PreviousOrder" = 4 WHERE "ID" = 3; INSERT INTO "NT_Run" ("MachineID", "OrderID", "ImportedFrom", "StartTime", "EndTime", "SimpleRunID", "Parameters") VALUES(3,4,'run4.json','2012-04-11 16:28:24.000000', - '2012-04-11 16:28:59.000000',NULL,'[]'); -- ID 4 + '2012-04-11 16:28:59.000000',NULL,CAST('[]' AS BLOB)); -- ID 4 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes") @@ -41,7 +41,7 @@ "EndTime", "SimpleRunID", "Parameters") VALUES(2,5,'run5.json','2012-05-01 16:28:23.000000', '2012-05-01 16:28:58.000000',NULL, - '[["producer", "http://buildbot.server.url/builders/some-builder/builds/987"]]'); -- ID 5 + CAST('[["producer", "http://buildbot.server.url/builders/some-builder/builds/987"]]' AS BLOB)); -- ID 5 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes") @@ -56,7 +56,7 @@ INSERT INTO "NT_Run" ("MachineID", "OrderID", "ImportedFrom", "StartTime", "EndTime", "SimpleRunID", "Parameters") VALUES(2,6,'run6.json','2012-05-03 16:28:24.000000', - '2012-05-03 16:28:59.000000',NULL,'[]'); -- ID 6 + '2012-05-03 16:28:59.000000',NULL,CAST('[]' AS BLOB)); -- ID 6 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes") @@ -78,17 +78,17 @@ "EndTime", "SimpleRunID", "Parameters") VALUES(2,6,'run7.json','2012-05-10 16:28:23.000000', '2012-05-10 16:28:58.000000',NULL, - '[["producer", "http://my.build.server/buildResult"]]'); -- ID 7 + CAST('[["producer", "http://my.build.server/buildResult"]]' AS BLOB)); -- ID 7 INSERT INTO "NT_Run" ("MachineID", "OrderID", "ImportedFrom", "StartTime", "EndTime", "SimpleRunID", "Parameters") VALUES(2,7,'run8.json','2012-05-11 16:28:23.000000', '2012-05-11 16:28:58.000000',NULL, - '[["producer", "https://my.build.server/buildResult"]]'); -- ID 8 + CAST('[["producer", "https://my.build.server/buildResult"]]' AS BLOB)); -- ID 8 INSERT INTO "NT_Run" ("MachineID", "OrderID", "ImportedFrom", "StartTime", "EndTime", "SimpleRunID", "Parameters") VALUES(2,8,'run9.json','2012-05-12 16:28:23.000000', '2012-05-12 16:28:58.000000',NULL, - '[["producer", "https://buildbot.server.url/builders/some-builder/builds/999"]]'); -- ID 9 + CAST('[["producer", "https://buildbot.server.url/builders/some-builder/builds/999"]]' AS BLOB)); -- ID 9 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes")