last_insert_id() is used in SQL in a couple of places in TikiWIki. This is a mysql-specific function that breaks functionality when other databases are used.
For TikiWiki CVS HEAD (1.10):
lib/articles/artlib.php:152: $query = "select `subId` from `tiki_submissions` where `subId`=last_insert_id()";
lib/multilingual/multilinguallib.php:28: $query = "insert into `tiki_translated_objects` (`type`,`objId`,`traId`,`lang`) values (?,?,last_insert_id(),?)";
Also present in TikiWiki 1.9.x
Reported by Thrain - thanks.
$adodb->genID() ?
mo0co0 says:
The proposed solution adodb.genID() is unpratical to use because it emulates
sequences in MySQL by using a dedicated table with one row and one column for
each sequence. This would have to be done throughout the co
used the the quick and dirty approach taken in other places by simply querying
for the just inserted tuple.
fix by mo0co0:
diff -u -d -r1.40.2.10 -r1.40.2.11
@@ -149,8 +149,9 @@
$result = $this->query($query,array($title,$authorName,(int) $topicId,$useImage,$imgname,(int) $imgsize,$imgtype,
$imgdata,(int) $publishDate,(int) $expireDate, (int) $now,$heading,$body,$hash,$user,0,0,0,(int) $size,$topicName,(int) $image_x,
(int) $image_y,$type,(float) $rating,$isfloat,$topline, $subtitle, $linkto, $image_caption, $lang));
- $query = "select `subId` from `tiki_submissions` where `subId`=last_insert_id()";
- $id = $this->getOne($query);
}
$emails = $notificationlib->get_mail_events('article_submitted', '*');
--
Fixed in 1.9.2-pre; awaiting merge for CVS head (1.10)
To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tiki.org instance. To start, simply select a version and click on "Create show2.tiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tiki.org.
To help developers solve the bug, we kindly request that you demonstrate your bug on a show.tikiwiki.org instance. To start, simply select a version and click on "Create show.tikiwiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show.tikiwiki.org.
filename | created | hits | comment | version | filetype | ||
---|---|---|---|---|---|---|---|
No attachments for this item |