Commit d3caf423 authored by Shinya Yamaoka's avatar Shinya Yamaoka Committed by Lukas Fleischer
Browse files

Fixes incorrect SQLs on generating dummy data.

The number of columns in the SQLs doesn't match the number of rows,
so an error like below occurs:

ERROR 1136 (21S01) at line 50929: Column count doesn't match value count
at row 1

Signed-off-by: default avatarShinya Yamaoka <>
Signed-off-by: default avatarLukas Fleischer <>
parent b56dceaa
......@@ -259,7 +259,7 @@ for p in list(seen_pkgs.keys()):
deptype = random.randrange(1, 5)
if deptype == 4:
dep += ": for " + random.choice([k for k in seen_pkgs])
s = "INSERT INTO PackageDepends VALUES (%d, %d, '%s', NULL);\n"
s = "INSERT INTO PackageDepends(PackageID, DepTypeID, DepName) VALUES (%d, %d, '%s');\n"
s = s % (seen_pkgs[p], deptype, dep)
......@@ -267,7 +267,7 @@ for p in list(seen_pkgs.keys()):
for i in range(0, num_deps):
rel = random.choice([k for k in seen_pkgs])
reltype = random.randrange(1, 4)
s = "INSERT INTO PackageRelations VALUES (%d, %d, '%s', NULL);\n"
s = "INSERT INTO PackageRelations(PackageID, RelTypeID, RelName) VALUES (%d, %d, '%s');\n"
s = s % (seen_pkgs[p], reltype, rel)
......@@ -279,7 +279,7 @@ for p in list(seen_pkgs.keys()):
p, RANDOM_TLDS[random.randrange(0,len(RANDOM_TLDS))],
src_file, genVersion())
s = "INSERT INTO PackageSources VALUES (%d, '%s');\n"
s = "INSERT INTO PackageSources(PackageID, Source) VALUES (%d, '%s');\n"
s = s % (seen_pkgs[p], src)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment