pri_id in eventum_issue table is to small: 127 max

Bug #1450152 reported by Vlad Safronov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Eventum
Fix Released
Medium
Elan Ruusamäe

Bug Description

Hi,

iss_pri_id is tinyint(1) in eventum_issue table and easily runs out out range on 30+ projects.
eventum_project_priority table has pri_id tinyint(1) unsigned and thus is inconsistent with iss_pri_id.

/v

Revision history for this message
Elan Ruusamäe (glen666) wrote :

you must of have very old database, it was changed to smallint(3) in 2005

care to post mysql alter statements to make it consistent and bigger?

Changed in eventum:
assignee: nobody → Elan Ruusamäe (glen666)
importance: Undecided → Medium
milestone: none → 3.0
status: New → Confirmed
Revision history for this message
Elan Ruusamäe (glen666) wrote :
Revision history for this message
Elan Ruusamäe (glen666) wrote :

from that commit, i can extract:

ALTER TABLE eventum_issue modify iss_pri_id smallint(3) NOT NULL default 0;
ALTER TABLE eventum_project_priority modify pri_id smallint(3) unsigned NOT NULL auto_increment;

do you have anything to add?

Revision history for this message
Vlad Safronov (vsafronov) wrote :

Thank you. This solved the trouble.
Yes, the database is pretty old :)

Revision history for this message
Elan Ruusamäe (glen666) wrote :

i asked you a question:

> you must of have very old database, it was changed to smallint(3) in 2005
> care to post mysql alter statements to make it consistent and bigger?

Revision history for this message
Vlad Safronov (vsafronov) wrote :

hm..

Which mysql alter statements to post?

I have applied the suggested above sql:
ALTER TABLE eventum_issue modify iss_pri_id smallint(3) NOT NULL default 0;
ALTER TABLE eventum_project_priority modify pri_id smallint(3) unsigned NOT NULL auto_increment;

Eventum entity is old, running since 2004 or 2005 and I was not one who installed. I upgraded this instance to 2.3.3.
Have I missed something, required database upgrade?

Revision history for this message
Elan Ruusamäe (glen666) wrote :

so, still, you found only two fields (the same ones i posted), and the size should be smallint(3)?

Revision history for this message
Vlad Safronov (vsafronov) wrote :

yes, I found only two fields,

well, I think SMALLINT is Ok, yet things are not totally consistent due to usage UNSIGNED in only one field:

+ iss_pri_id smallint(3) NOT NULL default 0,

+ pri_id smallint(3) unsigned NOT NULL auto_increment,

this would hardly cause a bug near future though (>32767), yet it is not correct.

Revision history for this message
Elan Ruusamäe (glen666) wrote : Re: [Bug 1450152] Re: pri_id in eventum_issue table is to small: 127 max

On 02.10.2015 15:19, Vlad Safronov wrote:
> yes, I found only two fields,
>
> well, I think SMALLINT is Ok, yet things are not totally consistent due
> to usage UNSIGNED in only one field:
>
> + iss_pri_id smallint(3) NOT NULL default 0,
>
> + pri_id smallint(3) unsigned NOT NULL auto_increment,
>
> this would hardly cause a bug near future though (>32767), yet it is not
> correct.
>

so, lets change to "smallint(3) unsigned" everywhere?

--
glen

Revision history for this message
Vlad Safronov (vsafronov) wrote :

Does Brian have any opinion on this? Brian made that change to SMALLINT, was that typo or intentional?
As I said this bug will hardly ever repeat with even SMALLINT..

I would just change booth to just plain INT and stop worring about.

Revision history for this message
Vlad Safronov (vsafronov) wrote :

s/booth/both/

Revision history for this message
Elan Ruusamäe (glen666) wrote :

committed as f9951348986d182feb2eff7cf4be01e430f98f52

https://github.com/glensc/eventum/commit/f9951348986d182feb2eff7cf4be01e430f98f52

will merge later (depends on prior PR to be merged)

Changed in eventum:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.