View Issue Details

IDProjectCategoryView StatusLast Update
0012082mantisbtdb mssqlpublic2014-09-23 18:05
Reportergenius_p Assigned Todregad  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.1 
Target Version1.2.9Fixed in Version1.2.9 
Summary0012082: call function token_create error
Description

In table mantis_tokens_table field Value is TEXT.
This function generate SQL query:
INSERT INTO mantis_tokens_table
( type, value, timestamp, expiry, owner )
VALUES ( 3, 1, 1276763353, 1276763653, 2)

SQL Server error text: "Operand type clash: int is incompatible with text";

Additional Information

Use db_type = 'mssqlnative'.
database_api 0011776 attached path applied.

Path fixed this issue in attache.

TagsNo tags attached.
Attached Files
tokens_api.path (615 bytes)   
--- C:/Users/Genius.COMPENG/Desktop/tokens_api.php	�� ��� 23 14:28:34 2010
+++ //iserv/e$/Mantis/web/core/tokens_api.php	�� �� 11 14:35:01 2010
@@ -200,7 +200,7 @@
 	$t_query = "INSERT INTO $t_tokens_table
 					( type, value, timestamp, expiry, owner )
 					VALUES ( " . db_param() . ', ' . db_param() . ', ' . db_param() . ', ' . db_param() . ', ' . db_param() . ' )';
-	db_query_bound( $t_query, Array( $c_type, $p_value, $c_timestamp, $c_expiry, $c_user_id ) );
+	db_query_bound( $t_query, Array( $c_type, "$p_value", $c_timestamp, $c_expiry, $c_user_id ) );
 	return db_insert_id( $t_tokens_table );
 }
 
tokens_api.path (615 bytes)   

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 
related to 0011776 closeddregad Support for Sql Server Native driver (sqlsrv) 

Activities

dregad

dregad

2012-01-02 12:18

developer   ~0030764

Patch applied, thanks for the fix.

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036349

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

grangeway

grangeway

2014-05-16 15:00

reporter   ~0040346

MantisBT currently supports Mysql and has support for other database engines.

The support for other databases is known to be problematic.

Having implemented the current database layer into Mantis 10 years ago, I'm currently working on replacing the current layer.

If you are interested in using Mantis with non-mysql databases - for example, Oracle, PGSQL or MSSQL, and would be willing to help out testing the new database layer, please drop me an email at paul@mantisforge.org

In the meantime, I'd advise running Mantis with Mysql Only to avoid issues.

Thanks
Paul

Related Changesets

MantisBT: master a105985e

2012-01-02 03:58

dregad


Details Diff
Fix SQL errors with SQL Server

This commit addresses 2 occurences of SQL Server error: "Operand type
clash: int is incompatible with text" which are triggered when calling
the following functions:

- config_set()
- token_create()
- token_update()

This is due to the field "Value" in the relevant Mantis table being of
type TEXT, while the corresponding value in the array passed in call to
db_query_bound() is not a string.

Thanks to genius_p for the original patch.

Fixes 0012081, 0012082
Affected Issues
0012081, 0012082
mod - core/config_api.php Diff File
mod - core/tokens_api.php Diff File

MantisBT: master-1.2.x fa332f30

2012-01-02 03:58

dregad


Details Diff
Fix SQL errors with SQL Server

This commit addresses 2 occurences of SQL Server error: "Operand type
clash: int is incompatible with text" which are triggered when calling
the following functions:

- config_set()
- token_create()
- token_update()

This is due to the field "Value" in the relevant Mantis table being of
type TEXT, while the corresponding value in the array passed in call to
db_query_bound() is not a string.

Thanks to genius_p for the original patch.

Fixes 0012081, 0012082
Affected Issues
0012081, 0012082
mod - core/config_api.php Diff File
mod - core/tokens_api.php Diff File