View Issue Details

IDProjectCategoryView StatusLast Update
0006021mantisbtinstallationpublic2005-09-11 08:12
Reporteraviru Assigned Tothraxisp  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
Fixed in Version1.0.0rc2 
Summary0006021: Mantis installation issues under sql server
Description

Intent: To setup tables in the SQL Server database.
Mantis installation of tables under Sql Server seems to fail.
Looking at the install.php code, the problem seems to be in the switch-case statement for selecting the appropriate database.

Session returns ado_mssql or odbc_mssql whereas the case does not have this entry (it has only mssql).

Modifying the switch-case as follows seemed to solve the tables-installation problem.

switch ($f_db_type) {
case 'mysql':
$t_support = function_exists('mysql_connect');
break;
case 'pgsql':
$t_support = function_exists('pg_connect');
break;
case 'mssql':
case 'ado_mssql':
case 'odbc_mssql' :
$f_db_type = 'mssql';
$t_support = function_exists('mssql_connect');
break;
default:
$t_support = false;
}

This installs the tables but the insert of initialization data fails.
kThe workaround I used was to tweal the sql statements and exeecute them in query analyzer. The statements I used are below:

SQL 1:

-- here I set the fields to be inserted in, removed first field as its an IDENTITY field, also set cookie string to ''

INSERT INTO mantis_user_table(username, realname, email, password, date_created, last_visit, enabled, protected, access_level, login_count, lost_password_request_count, failed_login_count, cookie_string) VALUES ( 'administrator', '', 'user@domain.com', '63a9f0ea7bb98050796b649e85481845', '2003-02-16 02:03:48', '2004-07-08 23:59:22', 1, 1, 90, 3, 0, 0, '');

GO

SQL 2:

-- here I replace 51 with '51' as value is a text field not an integer.

INSERT INTO mantis_config_table ( value, type, access_reqd, config_id, project_id, user_id ) VALUES ('51', 1, 90, 'database_version', 20, 0 );

Steps To Reproduce
  • Fire up the browser and execute install.php
  • The configuration screen comes up. Enter the sql server connectivity information and select either MSSQL with ADO or MSSQL with ODBC.
  • click on Install.
  • nothing seems to happen.

        switch ($f_db_type) {
            case 'mysql':
                $t_support = function_exists('mysql_connect');
                break;
            case 'pgsql':
                $t_support = function_exists('pg_connect');
                break;
            case 'mssql':
            case 'ado_mssql':
            case 'odbc_mssql' :
                $f_db_type = 'mssql';
                $t_support = function_exists('mssql_connect');
                break;
            default:
                $t_support = false;
        }
TagsNo tags attached.

Relationships

has duplicate 0006064 closedthraxisp SQL error installing Mantis with PHP 4.3.2 and MySQL distribution 4.1.11 under OS X 10.3.9 
has duplicate 0006232 closedthraxisp "Invalid" use of MD5() function 
related to 0006142 closedthraxisp PostgreSQL: creation of user failed 

Activities

grangeway

grangeway

2005-07-29 14:23

reporter   ~0011019

Issue 0 -> is already fixed in CVS
Issue 2 -> I believe thraxisp was fixing

Issue 1 -> I believe still needs addressing. The PHP needs to generate the cookie as opposed to the DB.

thraxisp

thraxisp

2005-07-30 13:15

reporter   ~0011028

Last edited: 2005-07-30 13:55

I've fixed issue 2, but I cannot find where issue 1 is generated. All of the inserts in that table have the value quoted.

Are you looking at the actual queries sent to the database, or inspecting the code?

thraxisp

thraxisp

2005-07-30 14:11

reporter   ~0011029

Fix for issue 2 submitted to CVS.

admin/install.php -> 1.16
admin/schema.php -> 1.6
core/config_api.php -> 1.35

grangeway

grangeway

2005-07-31 11:57

reporter   ~0011032

NOW() --> should be db_now() (or whatever api call is ) too

thraxisp

thraxisp

2005-08-01 09:50

reporter   ~0011040

Fixed in CVS. The second SQL issue is in a display statement shown is one chooses to install the database manually.

admin/install.php -> 1.18
admin/schema.php -> 1.7