[TYPO3-core] RFC: Bug #4951: SQL error when editing BE User

Michael Stucki michael at typo3.org
Fri Feb 16 14:04:39 CET 2007


Hi Thomas,

> I can't reproduce the error due to my mySQL version.
> Anyway, I'm not sure about the patch. I'm not too much inside WS and
> versioning but do you think it's a good idea to make the PK a signed int?
> If there are no complains about it, it's okay for me.

I'm not changing any keys! Just changing queries like this:

... WHERE pid in (-1,1,2,3,525,623)

into this:

... WHERE pid in (1,2,3,525,623)

Have a look at the Core API: It says that every versioned table requires a 
number of additional fields, whereas "versioningWS" is one of them. So I just 
check for its presence to be sure if the table uses versioning and thus is 
signed (it needs to be, otherwise versioning would not work).

> The second one is, wouldn't it make sense to avoid adding the "-1" instead
> of removing it by regex?

No, have a look at the code:

if ($pidList)	{
	while (list($table) = each($TCA))	{
		... execute the query using pidList ...
	}
}

The pidList comes from outside, so it must apply for all tables, versioned and 
not versioned ones. I see no other solution to that problem.

One more note: I know that the regex only matches "-1," at the beginning of 
pidList, but that is always the case anyway...

- michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070216/a9e1d4b1/attachment.pgp 


More information about the TYPO3-team-core mailing list