View Issue Details

IDProjectCategoryView StatusLast Update
0009806mantisbtdb postgresqlpublic2014-05-16 15:02
Reporterkukgini Assigned Tograngeway  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionno change required 
Platformx86 32bitOSlinuxOS Version2.6.24-21
Product Version1.2.0a2 
Summary0009806: PostgreSQL compatability Problem on create account
Description

when i create new account follwoing error occured
[code]
Database query failed. Error received from database was #-1: ERROR: column "enabled" is of type boolean but expression is of type integer
LINE 3: enabled, access_level, login_count, cookie_string, ...
^
HINT: You will need to rewrite or cast the expression. for the query: INSERT INTO mantis_user_table
( username, email, password, date_created, last_visit,
enabled, access_level, login_count, cookie_string, realname )
VALUES
( 'soominlee', 'soominlee@lgcns.com', '1f09d43620849b38cfb0c9b22e6cd865', '2008-11-12 23:26:25', '2008-11-12 23:26:25',
1, 25, 0, '6b717f7e6ba984b9c4df1c45ef429bd0dbecf85b5d52a05b3954255f1cf48c3c', '???')
[/code]

Tagspatch

Activities

olegos

olegos

2008-11-13 01:22

reporter   ~0019861

Last edited: 2008-11-13 01:28

Did you do a fresh install of Mantis 1.2.0a2, or upgrade from an earlier version?
What version of PostgreSQL?

In my installation of 1.2.0a2 with Postgres, mantis_user_table.enabled is
smallint | not null default 1

(I arrived at this version through a series of upgrades, last one from 1.1.3)

kukgini

kukgini

2008-11-13 02:46

reporter   ~0019862

PostgreSQL Version is 8.3 and fresh install.
manually create tables. (copy and paste web generated ddl scripts)

In my case mantis_user_table.enabled is boolean.
<code>
CREATE TABLE mantis_user_table
(
id serial NOT NULL,
username character varying(32) NOT NULL DEFAULT ''::character varying,
realname character varying(64) NOT NULL DEFAULT ''::character varying,
email character varying(64) NOT NULL DEFAULT ''::character varying,
"password" character varying(32) NOT NULL DEFAULT ''::character varying,
date_created timestamp without time zone NOT NULL DEFAULT '1970-01-01 00:00:01'::timestamp without time zone,
last_visit timestamp without time zone NOT NULL DEFAULT '1970-01-01 00:00:01'::timestamp without time zone,
enabled boolean NOT NULL DEFAULT true,
protected boolean NOT NULL DEFAULT false,
access_level smallint NOT NULL DEFAULT 10,
login_count integer NOT NULL DEFAULT 0,
lost_password_request_count smallint NOT NULL DEFAULT 0,
failed_login_count smallint NOT NULL DEFAULT 0,
cookie_string character varying(64) NOT NULL DEFAULT ''::character varying,
CONSTRAINT mantis_user_table_pkey PRIMARY KEY (id)
)
WITH (OIDS=FALSE);
ALTER TABLE mantis_user_table OWNER TO mantis;

-- Index: idx_access

-- DROP INDEX idx_access;

CREATE INDEX idx_access
ON mantis_user_table
USING btree
(access_level);

-- Index: idx_enable

-- DROP INDEX idx_enable;

CREATE INDEX idx_enable
ON mantis_user_table
USING btree
(enabled);

-- Index: idx_user_cookie_string

-- DROP INDEX idx_user_cookie_string;

CREATE UNIQUE INDEX idx_user_cookie_string
ON mantis_user_table
USING btree
(cookie_string);

-- Index: idx_user_username

-- DROP INDEX idx_user_username;

CREATE UNIQUE INDEX idx_user_username
ON mantis_user_table
USING btree
(username);

</code>

kukgini

kukgini

2008-11-13 02:57

reporter   ~0019863

drop the database and reinstall dosen't work. and my admin/scheme.php like this. intersting...

grep -n enabled admin/schema.php
216: enabled L NOTNULL DEFAULT \" '1' \",
314: enabled L NOTNULL DEFAULT \" '1' \",
324:$upgrade[] = Array('CreateIndexSQL',Array('idx_enable',db_get_table('mantis_user_table'),'enabled'));
327: "(username, realname, email, password, date_created, last_visit, enabled, protected, access_level, login_count, lost_password_request_count, failed_login_count, cookie_string) VALUES
371: enabled L NOTNULL DEFAULT \" '0' \"
398: ( basename, enabled ) VALUES

olegos

olegos

2008-11-13 09:49

reporter   ~0019866

Very interesting. I have all "L" fields in schema.php before "Release marker: 1.2.0-SVN" (line 367) as smallint, and all after that as boolean.

toxygen

toxygen

2008-11-17 18:26

reporter   ~0019920

darken:/home/www/mantis/core# diff user_api.php user_api.php.old
462c462
< '$c_enabled', $c_access_level, 0, '$t_cookie_string', '$c_realname')";

                               $c_enabled, $c_access_level, 0, '$t_cookie_string', '$c_realname')";

darken:/home/www/mantis/core#

this fixes it (however another unrelated error will show up, but it has already been reported as bug 0007616

grangeway

grangeway

2009-07-26 07:32

reporter   ~0022558

Hi guys,

These issues should all be fixedin 1.2rc - note: we've added a check to check.php to check people are running bundled adodb when using postgres as we've made some changes (mainly to the datadict files for schema creationg to support converting data types e.g. casting int->bool)

Paul

grangeway

grangeway

2014-05-16 15:02

reporter   ~0040540

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