Bug #81295 [Opn]: PDO_DBLIB: Run specific sql query get no result
| From: | bestlong168 at gmail dot com | Date: | Tue, 27 Jul 2021 01:44:55 +0000 |
| Subject: | Bug #81295 [Opn]: PDO_DBLIB: Run specific sql query get no result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-235387@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81295&edit=1
ID: 81295
User updated by: bestlong168 at gmail dot com
Reported by: bestlong168 at gmail dot com
-Summary: run sql query get no result
+Summary: PDO_DBLIB: Run specific sql query get no result
Status: Open
Type: Bug
Package: PDO DBlib
-Operating System: Ubuntu 20.04.2 LTS
+Operating System: Irrelevant
-PHP Version: 7.4.21
+PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
update PHP version and OS.
Previous Comments:
------------------------------------------------------------------------
[2021-07-26 00:37:40] bestlong168 at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=81295&edit=1