Closed (fixed)
Project:
LDAP integration
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
27 Apr 2012 at 11:13 UTC
Updated:
17 May 2012 at 22:00 UTC
Jump to comment: Most recent file
When installing or updating the latest dev-version, the database update throws an error. The new table "ldapauth_users" wont get created. It looks like the generated SQL contains a syntax error - the plain word "Array" instead of the content of an array. My database is Postgres 9.1
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | ldapauth.install.zip | 2.39 KB | superhenne |
| #1 | ldap_integration-postgres-unique-1550504-1.patch | 1.57 KB | cgmonroe |
| #1 | ldapauth.zip | 2.35 KB | cgmonroe |
Comments
Comment #1
cgmonroe commentedOk, I traced this back to a Drupal core PostGres api bug: #1148856: Postgres schema doesn't support keylength on a unique index.
This is happening because I was trying to insure that the uid and puid values were unique using SQL constraints. But since the puid could defined as an LDAP dn, the puid field needs to be a "text" field. MySQL needs a max length to index text fields... but PostGres doesn't and the API doesn't convert the schema definition properly.
Anyway, hoping for a fix in core (especially 6.x) is like waiting for snow in Miami. So here's a patch that tests for Postgres and sets up the unique key schema differently than for mysql.
I've also include the patched ldapauth.install file. To use test with this just replace the existing ldapauth.install with this one.
If this fixes the problem as expected, I'll commit it.
Comment #2
superhenne commentedThis solved the first problem but introduced another one - text fields do not have a length property in postgres. For a test i removed all "length" properties in ldapauth.install and now it works.
Comment #3
cgmonroe commentedSigh, I wish I could just assume that everyone would be using MySQL > 5.0.3.. then I could just use varchar(512). But the Drupal minimum for 6 is MySQL 4.0... Anyway, removing the lengths sounds like the best thing to do.
FWIW - The length was intended to help save some space and provide a bit of optimization (some versions of MySQL will let small length text fields be cached in memory rather than assume they need to be on disk because they are large). But reviewing the code, the ldapauth_users info isn't retrieved that much, so it shouldn't be a big performance hit.
These extra changes will be committed soon. Thanks for helping work out the PostGres issues.
Comment #4
cgmonroe commentedFix for this included in changes just committed.
See: #1475272: 6.x-1.0 Release Candidate 1 Status