Projects tigase _server server-core Issues #104
Borken stored procedure TigAllUsers() for PostgreSQL (#104)
Artur Hefczyc opened 1 decade ago

I just noticed that some of the stored procedures for postgres are not properly working in Tigase.

As you can see in https://projects.tigase.org/projects/tigase-server/repository/entry/trunk/database/postgresql-schema-4-sp.schema, more precisely in the TigAllUsers() function, there is a return clause prior to the select clause, and the return of the function is void.

Thus, when I try to use the method getUsers() from the userRepository in a new ad-hoc command, it returns an empty list of jids.

IMHO, these functions can be written in a less verbose way by using plain sql, just like this:

-- QUERY START:

-- List of all users in database

create or replace function TigAllUsers() returns setof record as

'select user_id, last_login, last_logout, online_status, failed_logins, account_status from tig_users;'

LANGUAGE 'sql';

-- QUERY END:

I'm not sure if the current code in the JDBCRepository class will be able to parse the results of this query, but it seems to be working in the psql client.

Andrzej Wójcik (Tigase) commented 1 decade ago

I checked and JDBCRepository was not able to handle results of this query. I changed implementation to make it work with PostgreSQL. Also there was problem with processing results of function by JDBC driver so I changed function as well.

Referenced from commit 1 year ago
issue 1 of 1
Type
Bug
Priority
Normal
Assignee
RedmineID
497
Version
tigase-server-5.1.0
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#104
Please wait...
Page is in error, reload to recover