View Issue Details

IDProjectCategoryView StatusLast Update
0011784mantisbtupgradepublic2012-02-20 07:18
ReporterNikoPetko Assigned Tograngeway  
PriorityhighSeverityblockReproducibilityalways
Status closedResolutionno change required 
PlatformVMOSMS OS VersionWinServer 2003
Product Version1.2.0 
Summary0011784: Upgrade 1.1.8 to 1.2.0 failed --> MSSQL database schema issue
Description

On the config page, everything was marked good except the last one (Schema CreateTableSQL) which was bad with the following error :

CREATE TABLE mantis_config_table ( config_id VARCHAR(64) NOT NULL, project_id INT DEFAULT 0 NOT NULL, user_id INT DEFAULT 0 NOT NULL, access_reqd INT DEFAULT 0, type INT DEFAULT 90, value TEXT NOT NULL, PRIMARY KEY (config_id, project_id, user_id) )
There is already an object named 'mantis_config_table' in the database.

I keep the same database used by Mantis 1.1.8, with all datas.

any ideas ?

Additional Information

I decide to upgrade because the file download didn't work. 0011697

IIS 6.0
MSSQL
PHP 5.3.2

TagsNo tags attached.

Relationships

has duplicate 0011811 closedatrol Error when upgrading from 1.1.8 to 1.2.0 (IIS + PHP + MSSQL) 

Activities

thraxisp

thraxisp

2010-04-12 07:30

reporter   ~0025100

You may be seeing the same issue as 0008846. The upgrades are triggered off of a specific database entry, and in an old Debian version, this was missing. There is a fix in the notes.

NikoPetko

NikoPetko

2010-04-13 04:59

reporter   ~0025110

Thank you for the quick answer.
I have read the issue and it is the error I got.

However, I am not running on Debian but MS Windows Server 2003, with MSSQL Server 2005 database.

When I set correctly the config_inc.php file an remove the admin folder, the mantis login_page.php displays well. But when I try to "signup for a new account" I got the following error :

APPLICATION ERROR 0000401
Database query failed. Error received from database was #0: The statement has been terminated. for the query: INSERT INTO mantis_user_table
( username, email, password, date_created, last_visit,
enabled, access_level, login_count, cookie_string, realname )
VALUES
( ?, ?, ?, ?, ?,
?,?,?,?, ?).

I have searched such an issue with my archi but not found yet (maybe I look in the wrong way ?).

Can you help me ?

NikoPetko

NikoPetko

2010-04-13 05:01

reporter   ~0025111

APPLICATION ERROR n°401 (and not issue 401)...

I thing you have guessed...

:-)

thraxisp

thraxisp

2010-04-13 07:50

reporter   ~0025113

Although the bug refers to a Debian problem, you appear to have the same issue. The installer is trying to regenerate your entire database, rather than upgrading it to the current schema. The missing entry referred to in the other bug causes this.

You may want to follow up on IRC as there are others who are more familiar with installing on MSSQL there.

NikoPetko

NikoPetko

2010-04-14 05:41

reporter   ~0025121

This is really strange : if I remove the mantis_config_table, I got the following error :

APPLICATION ERROR 0000401
Database query failed. Error received from database was 0000206: Operand type clash: int is incompatible with text for the query: INSERT INTO mantis_config_table
( value, type, access_reqd, config_id, project_id, user_id )
VALUES
(?, ?, ?, ?, ?,? ).

...

rzg

rzg

2010-05-11 12:54

reporter   ~0025472

Last edited: 2010-05-11 13:01

I too am having this issue in 1.2.1- MS SQL 2005, PHP 5.2.5 (with version of ntwdblib.dll=2000.80.194.0). The issue seems to be that it is unable to read the config from the database for whatever reason: If I go to the admin page directly (after commenting out the security check), I see "APPLICATION WARNING #100: Configuration option "database_version" not found."

I also see "Notice: Undefined index: user_get_field() for NO_USER in D:\mantis-stage\core\error_api.php on line 378", though that might be unrelated.

Check.php gets a messy error about the plugin table not existing, but I suppose that is expected when dealing with an older schema version.

Update: Running SQL profiler, it does correctly connect to the database and run "SELECT config_id, user_id, project_id, type, value, access_reqd FROM mantis_config_table" and gets 38 rows, so clearly the issue is after that step when processing the data that it read.

rzg

rzg

2010-05-11 14:41

reporter   ~0025476

Fixed the issue, per 0010742. Mantis 1.2.X is DOA for SQL server, and needs manual patches to 3 files to work. Hopefully these issues will be addressed in the next maintenance release.

rzg

rzg

2010-05-12 13:39

reporter   ~0025489

Also in tag_api.php you need to add at about line 439:
if ( db_is_mssql() ) {
$result = db_query( $query);
} else {
$result = db_query_bound( $query, $t_params );
}

Since the mssql query is done with the results inline. (I'm surprised that it isn't the opposite since Sql server likes subqueries and mysql doesn't, but I digress. SQL server works with either; if you invert the logic and use the subquery on mssql it works fine.)

cicatrix

cicatrix

2011-05-12 12:13

reporter   ~0028776

When this issue is resolved?

grangeway

grangeway

2012-02-08 16:26

reporter   ~0031204

Hi,

For the next release, we are working to fix mssql support with a new PDO database layer - from what i can tell this issue does not occur with the new pdo layer.