[aur-dev] [PATCH] 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: Shinya Yamaoka <contact@mail.libmacro.com> --- schema/gendummydata.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/schema/gendummydata.py b/schema/gendummydata.py index bb622d1..9ad5373 100755 --- a/schema/gendummydata.py +++ b/schema/gendummydata.py @@ -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) out.write(s) @@ -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) out.write(s) @@ -279,7 +279,7 @@ for p in list(seen_pkgs.keys()): p, RANDOM_TLDS[random.randrange(0,len(RANDOM_TLDS))], RANDOM_LOCS[random.randrange(0,len(RANDOM_LOCS))], 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) out.write(s) -- 2.1.3
On Sun, 07 Dec 2014 at 08:19:04, Shinya Yamaoka wrote:
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: Shinya Yamaoka <contact@mail.libmacro.com> --- schema/gendummydata.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) [...]
Looks good to me at a glance. We should probably extend the script to create architecture-specific depends/relations/sources as well, though.
Looks good to me at a glance. We should probably extend the script to create architecture-specific depends/relations/sources as well, though.
Thank you for your reviewing. Do you mean you would like to merge my patch after my extending the script?
On Tue, 16 Dec 2014 at 02:03:11, Shinya Yamaoka wrote:
Looks good to me at a glance. We should probably extend the script to create architecture-specific depends/relations/sources as well, though.
Thank you for your reviewing. Do you mean you would like to merge my patch after my extending the script?
I already queued your patch [1] and will merge it into master soon. It can still be extended later. [1] https://projects.archlinux.org/aur.git/commit/?id=d3caf423
On Tue, 16 Dec 2014 08:55:51 +0100 Lukas Fleischer <archlinux@cryptocrack.de> wrote:
On Tue, 16 Dec 2014 at 02:03:11, Shinya Yamaoka wrote:
Looks good to me at a glance. We should probably extend the script to create architecture-specific depends/relations/sources as well, though.
Thank you for your reviewing. Do you mean you would like to merge my patch after my extending the script?
I already queued your patch [1] and will merge it into master soon. It can still be extended later.
[1] https://projects.archlinux.org/aur.git/commit/?id=d3caf423
I understand. Thank you.
participants (2)
-
Lukas Fleischer
-
Shinya Yamaoka