Bug #57434 [Opn->Fbk]: SQL "ATTACH DATABASE" not work.

From: Date: Mon, 03 May 2021 11:52:52 +0000
Subject: Bug #57434 [Opn->Fbk]: SQL "ATTACH DATABASE" not work.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233653@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=57434&edit=1

 ID:                 57434
 Updated by:         cmb@php.net
 Reported by:        ono_matope at hotmail dot com
 Summary:            SQL "ATTACH DATABASE" not work.
-Status:             Open
+Status:             Feedback
 Type:               Bug
-Package:            PDO_SQLITE
+Package:            *General Issues
 Operating System:   Windows XP
 PHP Version:        5.2.0 RC4
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Is this still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>


Previous Comments:
------------------------------------------------------------------------
[2006-12-16 11:00:16] ono_matope at hotmail dot com

Description:
------------
PHP5.2
PDO_SQLite1.0.1
SQLite3.3.7 

PECL Module version 	1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6 2006/01/01 12:50:12 sniper Exp $
SQLite Library 	3.3.7undefined


I use PDO_SQLite 5.1.1. This module is so useful.
But I'm problem about I can't execute "ATTACH DATABASE".
When I execute following snippet,I get following message.

And I couldn't find "db2"table in sqlite_master table.
Now, I think the function "ATTACH" is bugged or  unimplemented yet.

So..I'll feel happy if you would fix it :)

Reproduce code:
---------------
$pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
$pdo->query("ATTACH DATABASE 'db2.sqlite3' AS db2;");
$stmt=$pdo->query('select * from db2.foo;');
while($result = $stmt->fetch(PDO::FETCH_ASSOC)){
  var_dump($result);
}


Expected result:
----------------
Output data about db2.foo.

Actual result:
--------------
string(64) "SQLSTATE[HY000]: General error: 1 no such table: db2.foo" 


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=57434&edit=1


Thread (1 message)

  • cmb@php.net
  • Unknown Message
    • cmb@php.net
« previous php.bugs (#233653) next »