[Typo3-dev] Versioning Fix
Mathias Schreiber [wmdb]
mathias.schreiber at wmdb.de
Wed Jan 12 16:53:59 CET 2005
Kasper Skårhøj wrote:
> First of all "auto_increment" is just MySQLs way of incrementing a field
> automatically and logically it doesn't follow that the values cannot be
> CHANGED as long as they are unique (what "PRIMARY KEY" means) and if the
> field is a signed integer, they clearly can be negative as well.
>
> It is so obvious that this is a MySQL bug which was corrected. What is
> the binary representation of a negative number? The first bit set! So if
> you look at the integer as if it was unsigned it would appear to be a
> very very large number - and that is exactly what the next-index pointer
> is set to be - the value just before the highest value of the field.
>
> As long as this seems so evident to be a bug I will not bow before an
> unhealthy implementation in MySQL.
To be honest I don't really understand the hostility, all we wanted to
do is help and contribute.
As I (!) see things versioning is part of the core (because it uses core
classes and isn't based on an extension).
MSSQL Server quits trying to UPDATE an PRIMARY_KEY with the message that
primary keys aren't allowed to be changed.
This is because they also do a lot more than only pointing to record A
but also point to block X on the harddisk.
Oracle also does not allow to change constraints because it would
corrupt the integrity of the database.
Not even MS Access allows this.
PostGres seems to allow it - but only as long as you don't use
contraints (Karsten, please clear things up here)
Reasons for another strategy in versioning are:
- If your database flips or the script crashes for whatever reasons, the
page with the negative ID is gone. If this is the root Page or something
similar you site is offline. This does not depend on the DB or MySQL
Version you are using.
- Other DBs being accessible through DBAL won't work with this
- Changing identifiers is generally bad habit
- What if mySQL "fixed" something to wrong?
- What if we run into problems lateron? Why not make it semantically
correct now?
--
No Subject - No Realname - No Service!
Respect the List/Newsgroup Rules!
>> http://typo3.org/1438.0.html <<
More information about the TYPO3-dev
mailing list