Mantis - Quercus
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
1859 | minor | always | 07-09-07 18:37 | 08-01-07 08:46 | |
|
|||||
Reporter: | toomasr | Platform: | |||
Assigned To: | nam | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 3.1.2 | ||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 3.1.3 | ||
|
|||||
Summary: | 0001859: JSR223: mysql_connect: Can't find database for driver | ||||
Description: |
Using Quercus (SVN trunk, the product version drop-down has no SVN branches) as a JSR-223 ScriptEngine. -------------- PHP ------------- mysql_connect("host", "username", "password"); mysql_select_db("dbname"); ----------- EOF PHP ------------- Produces: com.caucho.quercus.QuercusModuleException: Can't find database for driver 'com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource' and url 'jdbc:mysql://localhost:3306/' [^] [mysql_select_db] I went in with a debugger using the SVN trunk as reference. This is what I found out. As the connection requires the name of the database but PHP mysql interface insists on two calls (connect and select_db) then on eval'ing the first line the database name is missing and eval'ing the mysql_select_db the host, username, password are missing. In a container this is resolved by the QuercusServlet calling setDatabase on the Quercus object. Quercus object's database name is used in the lookup. In standalone environment there is no servlet and hence incomplete connection string. The current workaround seems to be using QuercusScriptEngine explicitly (not the ScriptEngine interface) and calling setDatabase on the Quercus object. The solution would be to provide a way of connecting to a database in two steps. First gather the information with mysql_connect and init the connection after mysql_select_db. Or maybe I'm missing something here :) |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: | patch.txt [^] (4,077 bytes) 07-10-07 15:55 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|