shibboleth-dev - Testing ODBC store
Subject: Shibboleth Developers
List archive
- From: giacomo tenaglia <>
- To:
- Subject: Testing ODBC store
- Date: Thu, 6 Dec 2007 16:08:51 +0100
Hi,
some news from my 2.0 ODBC session store testing.
JFTR I've had noproblems in rebuilding RPMs for Scientific Linux 4.5
from SRPMs.
Then I've tested a MySQL backend. The SQL sample code in odbc-store.cpp
works perfectly and creates the table structure, but shibd segfaults
even when invoked with -t. Last lines of a strace output follow:
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=48513984, ...}) = 0
mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7db6000
close(3) = 0
time(NULL) = 1196951531
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
So maybe the problem is related to the glibc, here at version 2.3.4.
unixODBC is at version 2.2.11-1.RHEL4.1, MyODBC is at version
2.50.39-25.RHEL4.1.
I've also tested a PostgreSQL backend. It was necessary to modify some
data types from the SQL sample code, I did it by looking at the "Data
Types" table at:
http://en.wikibooks.org/wiki/Programming:Converting_MySQL_to_PostgreSQL
The first problem I encountered was an "ODBC StorageService failed to
read version from database", taht I solved inserting into the table
"version" the values '1' and '0', guessing it wanted something matching
with the values of PLUGIN_VER_MAJOR and PLUGIN_VER_MINOR.
The second problem was a syntax error while inserting a new session in
the cache, generated from line 426 of odbc-store.cpp. I've modified the
line in this way (diff -ru):
--- shibboleth-2.0/odbc-store/odbc-store.cpp 2007-10-22 00:01:10.000000000
+0200
+++ shibboleth-2.0-gt/odbc-store/odbc-store.cpp 2007-12-06 14:23:20.000000000
+0100
@@ -423,7 +423,7 @@
char *scontext = makeSafeSQL(context);
char *skey = makeSafeSQL(key);
char *svalue = makeSafeSQL(value);
- string q = string("INSERT ") + table + " VALUES ('" + scontext + "','"
+ skey + "'," + timebuf + ",1,'" + svalue + "')";
+ string q = string("INSERT INTO ") + table + " VALUES ('" + scontext +
"','" + skey + "'," + timebuf + ",1,'" + svalue + "')";
freeSafeSQL(scontext, context);
freeSafeSQL(skey, key);
freeSafeSQL(svalue, value);
and everything works. I don't know if this was a good thing or just a
grok, I hope the former.
In the next days I will test an Oracle backend.
Ciao,
giacomo
--
giacomo tenaglia
Technical Student at CERN IT/DES-SIS
CNR Biblioteca d'Area di Bologna - http://biblio.bo.cnr.it
Phone +41 76 5003376 -
sip:
- Testing ODBC store, giacomo tenaglia, 12/06/2007
- RE: Testing ODBC store, Scott Cantor, 12/06/2007
- Re: Testing ODBC store, giacomo tenaglia, 12/14/2007
- RE: Testing ODBC store, Scott Cantor, 12/14/2007
- <Possible follow-up(s)>
- Re: Testing ODBC store, giacomo tenaglia, 12/08/2007
- RE: Testing ODBC store, Scott Cantor, 12/08/2007
- Re: Testing ODBC store, giacomo tenaglia, 12/10/2007
- RE: Testing ODBC store, Scott Cantor, 12/10/2007
- RE: Testing ODBC store, Scott Cantor, 12/10/2007
- Re: Testing ODBC store, giacomo tenaglia, 12/18/2007
Archive powered by MHonArc 2.6.16.