View Issue Details

IDProjectCategoryView StatusLast Update
0020894mantisbtdb postgresqlpublic2016-06-12 00:42
Reportertegger Assigned Todregad  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Platformx64OSWindowsOS VersionServer 2008R2
Product Version1.3.0-beta.1 
Target Version1.3.0-rc.2Fixed in Version1.3.0-rc.2 
Summary0020894: APPLICATION ERROR 401 @ user_edit_page when changing Accesslevel
Description

Hi,

i got an APPLICATION ERROR 0000401 when i downgrade a user from administrator level. We got also a 401 with view all entries, when a user is not an administrator, so i tried to reproduce this with my own account and got this error during downgrade my user account with administrator account.

It's running on IIS7.5 with Postgres 9.3

Additional Information

APPLICATION ERROR 0000401

Datenbankabfrage fehlgeschlagen. Die Reportmeldung lautet #-1: FEHLER: Operator existiert nicht: boolean = integer
LINE 1: ...ntismodern_user_table WHERE access_level>=$1 AND enabled = 1
^
HINT: Kein Operator stimmt mit dem angegebenen Namen und den Argumenttypen überein. Sie müssen möglicherweise ausdrückliche Typumwandlungen hinzufügen. für die Abfrage: SELECT COUNT(id) FROM mantismodern_user_table WHERE access_level>=$1 AND enabled = 1.
Bitte benutzen Sie die „Zurück“-Taste Ihres Browsers, um auf die vorhergehende Seite zurückzukehren. Dort können Sie den hier angezeigten Eintrag korrigieren oder eine andere Aktion ausführen. Über das Menü können Sie auch direkt zu einer anderen Aktion wechseln.

TagsNo tags attached.
Attached Files
ManitsError401.htm (15,727 bytes)   
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<title>MantisBT</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
	<link rel="stylesheet" type="text/css" href="http://ma24271.iservices.db.de/mantis/css/default.css" />
	<link rel="stylesheet" type="text/css" href="http://ma24271.iservices.db.de/mantis/css/jquery-ui-1.11.4.min.css" />
	<link rel="stylesheet" type="text/css" href="http://ma24271.iservices.db.de/mantis/css/common_config.php" />
	<link rel="stylesheet" type="text/css" href="http://ma24271.iservices.db.de/mantis/css/status_config.php" />
	<link rel="stylesheet" type="text/css" href="http://ma24271.iservices.db.de/mantis/css/bootstrap-3.3.5.min.css" />
	<link rel="stylesheet" type="text/css" href="http://ma24271.iservices.db.de/mantis/css/font-awesome-4.4.0.min.css" />
	<link rel="stylesheet" type="text/css" href="http://ma24271.iservices.db.de/mantis/css/ace-fonts.css" />
	<link rel="stylesheet" type="text/css" href="http://ma24271.iservices.db.de/mantis/css/ace.min.css" />
	<link rel="stylesheet" type="text/css" href="http://ma24271.iservices.db.de/mantis/css/ace-mantis.css" />
<!--[if lte IE 9]>	<link rel="stylesheet" type="text/css" href="http://ma24271.iservices.db.de/mantis/css/ace-part2.min.css" />
<![endif]-->	<link rel="stylesheet" type="text/css" href="http://ma24271.iservices.db.de/mantis/css/ace-skins.min.css" />
<!--[if lte IE 9]>	<link rel="stylesheet" type="text/css" href="http://ma24271.iservices.db.de/mantis/css/ace-ie.min.css" />
<![endif]-->
	<link rel="shortcut icon" href="/mantis/images/favicon.ico" type="image/x-icon" />
	<link rel="search" type="application/opensearchdescription+xml" title="MantisBT: Text Search" href="http://ma24271.iservices.db.de/mantis/browser_search_plugin.php?type=text" />
	<link rel="search" type="application/opensearchdescription+xml" title="MantisBT: Issue Id" href="http://ma24271.iservices.db.de/mantis/browser_search_plugin.php?type=id" />
	<script type="text/javascript" src="/mantis/javascript_config.php"></script>
	<script type="text/javascript" src="/mantis/javascript_translations.php"></script>
	<script type="text/javascript" src="/mantis/js/jquery-2.1.4.min.js"></script>
	<script type="text/javascript" src="/mantis/js/jquery-ui-1.11.4.min.js"></script>
	<script type="text/javascript" src="/mantis/js/common.js"></script>
</head>
<body class="skin-3">
<div class="col-md-12 col-xs-12"><div class="space-20"></div><div class="alert alert-danger"><p class="bold">APPLICATION ERROR #401</p><p>Datenbankabfrage fehlgeschlagen. Die Reportmeldung lautet #-1: FEHLER:  Operator existiert nicht: boolean = integer<br />
LINE 1: ...ntismodern_user_table WHERE access_level&gt;=$1 AND enabled = 1<br />
                                                                    ^<br />
HINT:  Kein Operator stimmt mit dem angegebenen Namen und den Argumenttypen überein. Sie müssen möglicherweise ausdrückliche Typumwandlungen hinzufügen. für die Abfrage: SELECT COUNT(id) FROM mantismodern_user_table WHERE access_level&gt;=$1 AND enabled = 1.</p><div class="error-info">Bitte benutzen Sie die „Zurück“-Taste Ihres Browsers, um auf die vorhergehende Seite zurückzukehren. Dort können Sie den hier angezeigten Eintrag korrigieren oder eine andere Aktion ausführen. Über das Menü können Sie auch direkt zu einer anderen Aktion wechseln.</div><p>		<table class="width-100">
			<tr>
				<td>Full path: C:\inetpub\wwwroot\mantis\core\database_api.php</td>
			</tr>
			<tr>
				<td>Line: 450</td>
			</tr>
			<tr>
				<td>
					<table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td style="width=20%; word-wrap:break-word; overflow:auto;">p_query</td><td style="width=70%; word-wrap:break-word; overflow:auto;">SELECT COUNT(id) FROM mantismodern_user_table WHERE access_level&gt;=$1 AND enabled = 1</td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">p_limit</td><td style="width=70%; word-wrap:break-word; overflow:auto;">-1</td><td style="width=10%;">integer</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">p_offset</td><td style="width=70%; word-wrap:break-word; overflow:auto;">-1</td><td style="width=10%;">integer</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">g_db_log_queries</td><td style="width=70%; word-wrap:break-word; overflow:auto;"></td><td style="width=10%;">boolean</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">t_db_type</td><td style="width=70%; word-wrap:break-word; overflow:auto;">pgsql</td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">s_check_params</td><td style="width=70%; word-wrap:break-word; overflow:auto;">1</td><td style="width=10%;">boolean</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">t_start</td><td style="width=70%; word-wrap:break-word; overflow:auto;">1462877631.4163</td><td style="width=10%;">double</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">t_params</td><td style="width=70%; word-wrap:break-word; overflow:auto;">1</td><td style="width=10%;">integer</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">i</td><td style="width=70%; word-wrap:break-word; overflow:auto;">1</td><td style="width=10%;">integer</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">s_prefix</td><td style="width=70%; word-wrap:break-word; overflow:auto;">mantismodern_</td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">s_suffix</td><td style="width=70%; word-wrap:break-word; overflow:auto;">_table</td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">t_result</td><td style="width=70%; word-wrap:break-word; overflow:auto;"></td><td style="width=10%;">boolean</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">t_elapsed</td><td style="width=70%; word-wrap:break-word; overflow:auto;">0.0000</td><td style="width=10%;">string</td></tr>
<tr><td colspan="3" style="word-wrap:break-word"><br /><strong>p_arr_parms</strong></td></tr><tr><td colspan="3"><table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td style="width=20%; word-wrap:break-word; overflow:auto;">0</td><td style="width=70%; word-wrap:break-word; overflow:auto;">90</td><td style="width=10%;">integer</td></tr>
</table></td></tr><tr><td colspan="3" style="word-wrap:break-word"><br /><strong>g_queries_array</strong></td></tr><tr><td colspan="3"><table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td colspan="3" style="word-wrap:break-word"><br /><strong>1</strong></td></tr><tr><td colspan="3"><table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td style="width=20%; word-wrap:break-word; overflow:auto;">0</td><td style="width=70%; word-wrap:break-word; overflow:auto;"></td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">1</td><td style="width=70%; word-wrap:break-word; overflow:auto;">0.0000</td><td style="width=10%;">string</td></tr>
</table></td></tr><tr><td colspan="3" style="word-wrap:break-word"><br /><strong>2</strong></td></tr><tr><td colspan="3"><table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td style="width=20%; word-wrap:break-word; overflow:auto;">0</td><td style="width=70%; word-wrap:break-word; overflow:auto;"></td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">1</td><td style="width=70%; word-wrap:break-word; overflow:auto;">0.0000</td><td style="width=10%;">string</td></tr>
</table></td></tr><tr><td colspan="3" style="word-wrap:break-word"><br /><strong>3</strong></td></tr><tr><td colspan="3"><table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td style="width=20%; word-wrap:break-word; overflow:auto;">0</td><td style="width=70%; word-wrap:break-word; overflow:auto;"></td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">1</td><td style="width=70%; word-wrap:break-word; overflow:auto;">0.0000</td><td style="width=10%;">string</td></tr>
</table></td></tr><tr><td colspan="3" style="word-wrap:break-word"><br /><strong>4</strong></td></tr><tr><td colspan="3"><table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td style="width=20%; word-wrap:break-word; overflow:auto;">0</td><td style="width=70%; word-wrap:break-word; overflow:auto;"></td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">1</td><td style="width=70%; word-wrap:break-word; overflow:auto;">0.0000</td><td style="width=10%;">string</td></tr>
</table></td></tr><tr><td colspan="3" style="word-wrap:break-word"><br /><strong>5</strong></td></tr><tr><td colspan="3"><table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td style="width=20%; word-wrap:break-word; overflow:auto;">0</td><td style="width=70%; word-wrap:break-word; overflow:auto;"></td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">1</td><td style="width=70%; word-wrap:break-word; overflow:auto;">0.0000</td><td style="width=10%;">string</td></tr>
</table></td></tr><tr><td colspan="3" style="word-wrap:break-word"><br /><strong>6</strong></td></tr><tr><td colspan="3"><table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td style="width=20%; word-wrap:break-word; overflow:auto;">0</td><td style="width=70%; word-wrap:break-word; overflow:auto;"></td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">1</td><td style="width=70%; word-wrap:break-word; overflow:auto;">0.0000</td><td style="width=10%;">string</td></tr>
</table></td></tr><tr><td colspan="3" style="word-wrap:break-word"><br /><strong>7</strong></td></tr><tr><td colspan="3"><table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td style="width=20%; word-wrap:break-word; overflow:auto;">0</td><td style="width=70%; word-wrap:break-word; overflow:auto;"></td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">1</td><td style="width=70%; word-wrap:break-word; overflow:auto;">0.0000</td><td style="width=10%;">string</td></tr>
</table></td></tr><tr><td colspan="3" style="word-wrap:break-word"><br /><strong>8</strong></td></tr><tr><td colspan="3"><table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td style="width=20%; word-wrap:break-word; overflow:auto;">0</td><td style="width=70%; word-wrap:break-word; overflow:auto;"></td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">1</td><td style="width=70%; word-wrap:break-word; overflow:auto;">0.0000</td><td style="width=10%;">string</td></tr>
</table></td></tr><tr><td colspan="3" style="word-wrap:break-word"><br /><strong>9</strong></td></tr><tr><td colspan="3"><table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td style="width=20%; word-wrap:break-word; overflow:auto;">0</td><td style="width=70%; word-wrap:break-word; overflow:auto;"></td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">1</td><td style="width=70%; word-wrap:break-word; overflow:auto;">0.0000</td><td style="width=10%;">string</td></tr>
</table></td></tr><tr><td colspan="3" style="word-wrap:break-word"><br /><strong>10</strong></td></tr><tr><td colspan="3"><table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td style="width=20%; word-wrap:break-word; overflow:auto;">0</td><td style="width=70%; word-wrap:break-word; overflow:auto;"></td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">1</td><td style="width=70%; word-wrap:break-word; overflow:auto;">0.0000</td><td style="width=10%;">string</td></tr>
</table></td></tr><tr><td colspan="3" style="word-wrap:break-word"><br /><strong>11</strong></td></tr><tr><td colspan="3"><table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td style="width=20%; word-wrap:break-word; overflow:auto;">0</td><td style="width=70%; word-wrap:break-word; overflow:auto;"></td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">1</td><td style="width=70%; word-wrap:break-word; overflow:auto;">0.0156</td><td style="width=10%;">string</td></tr>
</table></td></tr><tr><td colspan="3" style="word-wrap:break-word"><br /><strong>12</strong></td></tr><tr><td colspan="3"><table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td style="width=20%; word-wrap:break-word; overflow:auto;">0</td><td style="width=70%; word-wrap:break-word; overflow:auto;"></td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">1</td><td style="width=70%; word-wrap:break-word; overflow:auto;">0.0000</td><td style="width=10%;">string</td></tr>
</table></td></tr><tr><td colspan="3" style="word-wrap:break-word"><br /><strong>13</strong></td></tr><tr><td colspan="3"><table class="width100" style="table-layout:fixed;"><tr><th>Variable</th><th>Value</th><th>Type</th></tr><tr><td style="width=20%; word-wrap:break-word; overflow:auto;">0</td><td style="width=70%; word-wrap:break-word; overflow:auto;"></td><td style="width=10%;">string</td></tr>
<tr><td style="width=20%; word-wrap:break-word; overflow:auto;">1</td><td style="width=70%; word-wrap:break-word; overflow:auto;">0.0000</td><td style="width=10%;">string</td></tr>
</table></td></tr></table></td></tr></table>				</td>
			</tr>
		</table>
</p><p><div class="table-responsive"><table class="table table-bordered table-striped table-condensed"><tr><th>Filename</th><th>Line</th><th></th><th></th><th>Function</th><th>Args</th></tr><tr><td>C:\inetpub\wwwroot\mantis\core\database_api.php</td><td>450</td><td>-</td><td>-</td><td>trigger_error</td><td>( &lt;string&gt;'401', &lt;integer&gt;256 )</td></tr><tr><td>C:\inetpub\wwwroot\mantis\core\user_api.php</td><td>512</td><td>-</td><td>-</td><td>db_query</td><td>( &lt;string&gt;'SELECT COUNT(id) FROM {user} WHERE access_level&gt;=$1 AND enabled = 1', &lt;array&gt; { [0] =&gt; 90 } )</td></tr><tr><td>C:\inetpub\wwwroot\mantis\manage_user_update.php</td><td>143</td><td>-</td><td>-</td><td>user_count_level</td><td>( &lt;integer&gt;90, &lt;boolean&gt;true )</td></tr></table></p></div></div>	<script type="text/javascript" src="/mantis/js/bootstrap-3.3.5.min.js"></script>
	<script type="text/javascript" src="/mantis/js/ace-extra.min.js"></script>
	<script type="text/javascript" src="/mantis/js/ace-elements.min.js"></script>
	<script type="text/javascript" src="/mantis/js/ace.min.js"></script>
</div>
</body>
</html>
ManitsError401.htm (15,727 bytes)   

Relationships

related to 0020483 closedcproensa Error 401 with PostgreSQL manage_user_page 
related to 0014398 closeddregad Support for PostgreSQL broken in 1.3 

Activities

dregad

dregad

2016-05-10 06:29

developer   ~0053108

Hello,

Thanks for the bug report. It would be helpful if you could temporarily enable detailed error reporting, to identify exactly what part of the code is causing the problem:

$g_show_detailed_errors = ON;

WARNING - SECURITY RISK: the 'show_detailed_errors' config can cause MantisBT to display sensitive information about your system. We recommend to restrict its activation to a Test environment, only for as long as necessary. If possible, do not turn it ON globally, instead limit it for specific user(s) using the Manage Configuration page.

  1. Reproduce the error
  2. save the output of the error screen, preferably as an HTML page (I'm mostly interested in the call stack)
  3. be careful to remove/mask any confidential information if needed
  4. upload the results here
tegger

tegger

2016-05-10 06:57

reporter   ~0053110

ok, done

dregad

dregad

2016-05-10 08:04

developer   ~0053113

I can reproduce this behavior with a fresh install on pgsql.

dregad

dregad

2016-05-10 09:31

developer   ~0053114

Pull request https://github.com/mantisbt/mantisbt/pull/775

tegger

tegger

2016-05-11 03:17

reporter   ~0053117

thx, with your changes it seems to be working

dregad

dregad

2016-05-11 09:22

developer   ~0053120

Thanks for the feedback.

Related Changesets

MantisBT: master 1b842729

2016-05-10 05:07

dregad


Details Diff
pgsql: integer vs boolean issue in user_count_level()

Use a query parameter instead of hardcoded 0/1 values so ADOdb
automatically converts the data type.

Fixes 0020894
Affected Issues
0020894
mod - core/user_api.php Diff File