Bug #81295 [NEW]: run sql query get no result
| From: | bestlong168 at gmail dot com | Date: | Mon, 26 Jul 2021 00:37:40 +0000 |
| Subject: | Bug #81295 [NEW]: run sql query get no result | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-235342@lists.php.net to get a copy of this message | ||
From: bestlong168 at gmail dot com
Operating system: Ubuntu 20.04.2 LTS
PHP version: 7.4.21
Package: PDO DBlib
Bug Type: Bug
Bug description:run sql query get no result
Description:
------------
The following SQL query run on MS Query, FreeTSD tsql will get 10 row
result, but run dblib query get no result.
select row_num = identity(int,1,1), *
into #b_resources
from (
select * from (select top 20 * from b_resources) A
union all
select * from b_resources where 1=2
) B;
select * from #b_resources where row_num between 11 and 20;
drop table #b_resources;
Test script:
---------------
$sql = 'select row_num = identity(int,1,1), * into #b_resources from
(select * from (select top 20 * from b_resources) A union all select *
from b_resources where 1=2 ) B; select * from #b_resources where row_num
between 11 and 20;drop table #b_resources;';
$rows = [];
foreach($conn->query($sql) as $row) {
$rows[] = $row;
}
dump($rows);
Expected result:
----------------
get 10 row result
Actual result:
--------------
no result
--
Edit bug report at https://bugs.php.net/bug.php?id=81295&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=81295&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=81295&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=81295&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=81295&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=81295&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=81295&r=support
Expected behavior: https://bugs.php.net/fix.php?id=81295&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=81295&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=81295&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=81295&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81295&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=81295&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=81295&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=81295&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=81295&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=81295&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=81295&r=mysqlcfg