developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.
#923 closed enhancement (fixed)
*pattern of DAO not working with field included in the PRIMARY index of a table
Reported by: | yan_vn | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | Jelix 1.2 beta |
Component: | jelix:dao | Version: | 1.1 |
Severity: | normal | Keywords: | PRIMARY KEY, SQL, updatepattern, insertpattern, updatepattern |
Cc: | Blocked By: | ||
Blocking: | Documentation needed: | no | |
Hosting Provider: | Local (OS X Leopard) | Php version: | 5.2.6 |
Description
If a field of a table is part of the PRIMARY KEY index on this table, the insertpattern and updatepattern attributes don't work. In my case in want to use the value now() which is not possible with the default attribute of MySQL 5.1.
If the PRIMARY KEY is modified so the said field not included, *pattern attributes work normally. No other collateral bug is detected.
Change History (4)
comment:1 Changed 11 years ago by laurentj
- Component changed from jelix to jelix:dao
- Milestone set to Jelix 1.1.5
comment:2 Changed 11 years ago by laurentj
- Milestone changed from Jelix 1.1.5 to Jelix 1.2
- Resolution set to fixed
- Status changed from new to closed
- Type changed from bug to enhancement
For primary keys, updatepattern doesn't work because it doesn't make sens to change a primary key, in a RDBMS.
Why not to have an insertpattern for a primary key which is not auto incremented. However, first, this is not a bug, just an improvment, and second, I do this improvement only in the trunk. Too risky to add this into the current stable branch 1.1.x, since it can change some behaviors. (and add too much work to backport the patch on these branch).
comment:3 Changed 11 years ago by laurentj
- Documentation needed set
comment:4 Changed 11 years ago by laurentj
- Documentation needed unset
If the primary key is declared as autoincrement, this is normal. however, if this bug exists for non autoincrement primary key, we should fix that.