|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-07-20 07:28 UTC] tony2001@php.net
[2006-07-28 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 01:00:02 2025 UTC |
Description: ------------ user aggregate function on empty select result Apache crach Reproduce code: --------------- function actstep(&$context,$tau,$val) { if ($conext[0]<$tau) { $conext[0]=$tau; $context[1]=$val; } } function actfin(&$context) { return $context[1]; } $f = 'tmp.sqlt'; unlink($f); $h = sqlite_open($f); sqlite_exec($h,"CREATE TABLE lnk(obj,atr,tau,val)"); sqlite_exec($h,"INSERT INTO lnk VALUES(1,1,2,5)"); sqlite_exec($h,"INSERT INTO lnk VALUES(1,1,5,10)"); sqlite_create_aggregate($h,'actual','actstep','actfin'); // This work: $r1 = sqlite_array_query($h,"SELECT actual(tau,val) FROM lnk WHERE obj=1 AND atr=1 AND tau<=10",SQLITE_NUM); // When empty result set Apache crach: $r2 = sqlite_array_query($h,"SELECT actual(tau,val) FROM lnk WHERE obj=2 AND atr=1 AND tau<=10",SQLITE_NUM); var_dump($r1); var_dump($r2); Expected result: ---------------- array(1) { [0]=> array(1) { [0]=> string(2) "10" } } null Actual result: -------------- Crach