Francois Gouget : testbot: Increase the unique Job/Patch/RecordGroup id limits.

Alexandre Julliard julliard at winehq.org
Thu Mar 18 15:57:04 CDT 2021


Module: tools
Branch: master
Commit: b5e9137932dc3e534ade627fdadd09c84fa23cf0
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=b5e9137932dc3e534ade627fdadd09c84fa23cf0

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Mar 17 07:55:26 2021 +0100

testbot: Increase the unique Job/Patch/RecordGroup id limits.

First we don't actually care about the SQL formatting directives (i.e.
the '(5)' in 'INT(5)'), and these have no impact on the allowed range.
They are changed anyway only for consistency with the TestBot ORM
declarations.
However the TestBot ORM enforces the declared maximum number of digits.
So increase those to allow the full range of the underlying database
type, which in this case is 0..2^31-1.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/ddl/update45.sql                | 24 ++++++++++++++++++++++++
 testbot/ddl/winetestbot.sql             | 18 +++++++++---------
 testbot/lib/WineTestBot/Jobs.pm         |  2 +-
 testbot/lib/WineTestBot/Patches.pm      |  4 ++--
 testbot/lib/WineTestBot/RecordGroups.pm |  2 +-
 testbot/lib/WineTestBot/Records.pm      |  2 +-
 testbot/lib/WineTestBot/Steps.pm        |  2 +-
 testbot/lib/WineTestBot/StepsTasks.pm   |  2 +-
 testbot/lib/WineTestBot/Tasks.pm        |  2 +-
 9 files changed, 41 insertions(+), 17 deletions(-)

diff --git a/testbot/ddl/update45.sql b/testbot/ddl/update45.sql
new file mode 100644
index 0000000..a04dba1
--- /dev/null
+++ b/testbot/ddl/update45.sql
@@ -0,0 +1,24 @@
+USE winetestbot;
+
+ALTER TABLE Patches
+  MODIFY Id INT NOT NULL AUTO_INCREMENT,
+  MODIFY WebPatchId INT NULL;
+
+ALTER TABLE PendingPatches
+  MODIFY PatchId INT NOT NULL;
+
+ALTER TABLE Jobs
+  MODIFY Id INT NOT NULL AUTO_INCREMENT,
+  MODIFY PatchId INT NULL;
+
+ALTER TABLE Steps
+  MODIFY JobId INT NOT NULL;
+
+ALTER TABLE Tasks
+  MODIFY JobId INT NOT NULL;
+
+ALTER TABLE RecordGroups
+  MODIFY Id INT NOT NULL AUTO_INCREMENT;
+
+ALTER TABLE Records
+  MODIFY RecordGroupId INT NOT NULL;
diff --git a/testbot/ddl/winetestbot.sql b/testbot/ddl/winetestbot.sql
index 1794b25..3b5cda7 100644
--- a/testbot/ddl/winetestbot.sql
+++ b/testbot/ddl/winetestbot.sql
@@ -66,8 +66,8 @@ ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE Patches
 (
-  Id          INT(7)          NOT NULL AUTO_INCREMENT,
-  WebPatchId  INT(7)          NULL,
+  Id          INT             NOT NULL AUTO_INCREMENT,
+  WebPatchId  INT             NULL,
   Received    DATETIME        NOT NULL,
   Disposition VARCHAR(40)     NOT NULL,
   FromName    VARCHAR(40)     NULL,
@@ -94,7 +94,7 @@ CREATE TABLE PendingPatches
   PendingPatchSetVersion    INT(2)      NOT NULL,
   PendingPatchSetTotalParts INT(2)      NOT NULL,
   No                        INT(2)      NOT NULL,
-  PatchId                   INT(7)      NOT NULL,
+  PatchId                   INT         NOT NULL,
   FOREIGN KEY (PendingPatchSetEMail, PendingPatchSetVersion, PendingPatchSetTotalParts)
           REFERENCES PendingPatchSets(EMail, Version, TotalParts),
   FOREIGN KEY (PatchId) REFERENCES Patches(Id),
@@ -112,7 +112,7 @@ ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE Jobs
 (
-  Id         INT(5)      NOT NULL AUTO_INCREMENT,
+  Id         INT         NOT NULL AUTO_INCREMENT,
   BranchName VARCHAR(20) NOT NULL,
   UserName   VARCHAR(40) NOT NULL,
   Priority   INT(1)      NOT NULL,
@@ -120,7 +120,7 @@ CREATE TABLE Jobs
   Remarks    VARCHAR(128) NULL,
   Submitted  DATETIME    NOT NULL,
   Ended      DATETIME    NULL,
-  PatchId    INT(7)      NULL,
+  PatchId    INT         NULL,
   FOREIGN KEY (BranchName) REFERENCES Branches(Name),
   FOREIGN KEY (UserName) REFERENCES Users(Name),
   FOREIGN KEY (PatchId) REFERENCES Patches(Id),
@@ -130,7 +130,7 @@ ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE Steps
 (
-  JobId                 INT(5) NOT NULL,
+  JobId                 INT    NOT NULL,
   No                    INT(2) NOT NULL,
   PreviousNo            INT(2) NULL,
   Type                  ENUM('suite', 'single', 'build', 'reconfig') NOT NULL,
@@ -148,7 +148,7 @@ ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE Tasks
 (
-  JobId        INT(5) NOT NULL,
+  JobId        INT    NOT NULL,
   StepNo       INT(2) NOT NULL,
   No           INT(2) NOT NULL,
   Status       ENUM('queued', 'running', 'completed', 'badpatch', 'badbuild', 'boterror', 'canceled', 'skipped') NOT NULL,
@@ -166,7 +166,7 @@ ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE RecordGroups
 (
-  Id           INT(6) NOT NULL AUTO_INCREMENT,
+  Id           INT      NOT NULL AUTO_INCREMENT,
   Timestamp    DATETIME NOT NULL,
   PRIMARY KEY (Id)
 )
@@ -174,7 +174,7 @@ ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE Records
 (
-  RecordGroupId INT(6) NOT NULL,
+  RecordGroupId INT NOT NULL,
   Type         ENUM('engine', 'tasks', 'vmresult', 'vmstatus') NOT NULL,
   Name         VARCHAR(96) NOT NULL,
   Value        VARCHAR(64) NULL,
diff --git a/testbot/lib/WineTestBot/Jobs.pm b/testbot/lib/WineTestBot/Jobs.pm
index aeecea0..5dbc1a7 100644
--- a/testbot/lib/WineTestBot/Jobs.pm
+++ b/testbot/lib/WineTestBot/Jobs.pm
@@ -446,7 +446,7 @@ sub CreateItem($)
 }
 
 my @PropertyDescriptors = (
-  CreateBasicPropertyDescriptor("Id", "Job", 1, 1, "S",  5),
+  CreateBasicPropertyDescriptor("Id", "Job", 1, 1, "S",  10),
   CreateItemrefPropertyDescriptor("Branch", "Branch", !1, 1, \&CreateBranches, ["BranchName"]),
   CreateItemrefPropertyDescriptor("User", "Author", !1, 1, \&CreateUsers, ["UserName"]),
   CreateBasicPropertyDescriptor("Priority", "Priority", !1, 1, "N", 1),
diff --git a/testbot/lib/WineTestBot/Patches.pm b/testbot/lib/WineTestBot/Patches.pm
index cb8c78c..b6a8af4 100644
--- a/testbot/lib/WineTestBot/Patches.pm
+++ b/testbot/lib/WineTestBot/Patches.pm
@@ -453,8 +453,8 @@ sub CreateItem($)
 }
 
 my @PropertyDescriptors = (
-  CreateBasicPropertyDescriptor("Id", "Patch id", 1, 1, "S",  7),
-  CreateBasicPropertyDescriptor("WebPatchId", "Wine Web Patch id", !1, !1, "N",  7),
+  CreateBasicPropertyDescriptor("Id", "Patch id", 1, 1, "S",  10),
+  CreateBasicPropertyDescriptor("WebPatchId", "Wine Web Patch id", !1, !1, "N",  10),
   CreateBasicPropertyDescriptor("Received", "Received", !1, 1, "DT", 19),
   CreateBasicPropertyDescriptor("FromName", "Author", !1, !1, "A", 40),
   CreateBasicPropertyDescriptor("FromEMail", "Author's email address", !1, !1, "A", 40),
diff --git a/testbot/lib/WineTestBot/RecordGroups.pm b/testbot/lib/WineTestBot/RecordGroups.pm
index 27cedfe..f094543 100644
--- a/testbot/lib/WineTestBot/RecordGroups.pm
+++ b/testbot/lib/WineTestBot/RecordGroups.pm
@@ -73,7 +73,7 @@ sub CreateItem($)
 }
 
 my @PropertyDescriptors = (
-  CreateBasicPropertyDescriptor("Id",          "Group id",   1,  1, "S",  6),
+  CreateBasicPropertyDescriptor("Id",          "Group id",   1,  1, "S",  10),
   CreateBasicPropertyDescriptor("Timestamp",   "Timestamp", !1,  1, "DT", 19),
   CreateDetailrefPropertyDescriptor("Records", "Records",   !1, !1, \&CreateRecords),
 );
diff --git a/testbot/lib/WineTestBot/Records.pm b/testbot/lib/WineTestBot/Records.pm
index 00364f2..fd8e574 100644
--- a/testbot/lib/WineTestBot/Records.pm
+++ b/testbot/lib/WineTestBot/Records.pm
@@ -83,7 +83,7 @@ my @PropertyDescriptors = (
   CreateBasicPropertyDescriptor("Value", "Value", !1, !1, "A", 64),
 );
 my @FlatPropertyDescriptors = (
-  CreateBasicPropertyDescriptor("RecordGroupId", "Group id", 1, 1, "S", 6),
+  CreateBasicPropertyDescriptor("RecordGroupId", "Group id", 1, 1, "S", 10),
   @PropertyDescriptors
 );
 
diff --git a/testbot/lib/WineTestBot/Steps.pm b/testbot/lib/WineTestBot/Steps.pm
index 921077b..0f65d63 100644
--- a/testbot/lib/WineTestBot/Steps.pm
+++ b/testbot/lib/WineTestBot/Steps.pm
@@ -247,7 +247,7 @@ my @PropertyDescriptors = (
 );
 SetDetailrefKeyPrefix("Step", @PropertyDescriptors);
 my @FlatPropertyDescriptors = (
-  CreateBasicPropertyDescriptor("JobId", "Job id", 1, 1, "S", 5),
+  CreateBasicPropertyDescriptor("JobId", "Job id", 1, 1, "S", 10),
   @PropertyDescriptors
 );
 
diff --git a/testbot/lib/WineTestBot/StepsTasks.pm b/testbot/lib/WineTestBot/StepsTasks.pm
index a9326be..0b1655a 100644
--- a/testbot/lib/WineTestBot/StepsTasks.pm
+++ b/testbot/lib/WineTestBot/StepsTasks.pm
@@ -177,7 +177,7 @@ sub CreateItem($)
 
 # Note: To simplify maintenance replace enums with simple string fields.
 my @PropertyDescriptors = (
-  CreateBasicPropertyDescriptor("Id", "Id", 1, 1, "N", 4),
+  CreateBasicPropertyDescriptor("Id", "Id", 1, 1, "N", 10),
   CreateBasicPropertyDescriptor("StepNo", "Step", !1, 1, "N", 2),
   CreateBasicPropertyDescriptor("PreviousNo", "Previous step", !1, !1, "N", 2),
   CreateBasicPropertyDescriptor("TaskNo", "Task", !1, 1, "N", 2),
diff --git a/testbot/lib/WineTestBot/Tasks.pm b/testbot/lib/WineTestBot/Tasks.pm
index 141fee0..5cc2cc6 100644
--- a/testbot/lib/WineTestBot/Tasks.pm
+++ b/testbot/lib/WineTestBot/Tasks.pm
@@ -368,7 +368,7 @@ my @PropertyDescriptors = (
   CreateBasicPropertyDescriptor("TestFailures", "Failures", !1, !1, "N", 6),
 );
 my @FlatPropertyDescriptors = (
-  CreateBasicPropertyDescriptor("JobId", "Job id", 1, 1, "S", 5),
+  CreateBasicPropertyDescriptor("JobId", "Job id", 1, 1, "S", 10),
   CreateBasicPropertyDescriptor("StepNo", "Step no",  1,  1, "N", 2),
   @PropertyDescriptors
 );




More information about the wine-cvs mailing list