[ejabberd] MySQL test database schema

Oleg Motienko motienko at gmail.com
Sun Jan 8 12:30:46 MSK 2006


Hello,

On 12/23/05, Mickael Remond <mickael.remond at process-one.net> wrote:

> I did commit yesterday the change to support MySQL in ejabberd:
> http://support.process-one.net/code/web/ejabberd/change?id=1791&key=1879646207
>
> Modifying the Schema is not the only change to do and some changes had
> to be made to the code.
> It would be nice if you could check the version to see if it is working
> for you (Data to do the checkout are available from:
> http://www.process-one.net/en/projects/ejabberd/download.html#svn).

I find little,  but an appreciable bug with mysql backend.
When escaping SQL request, characters '_' and '%' changing to '\_' and '\%'.
This is cause for example, incorrect roster information in database.

I made temporary hack of "escape" function:

--- ejabberd_odbc.erl      Wed Jan  4 19:22:15 2006
+++ ejabberd_odbc.erl   Sun Jan  8 08:53:56 2006
@@ -93,8 +93,6 @@
         $\r -> "\\r";
         $'  -> "\\'";
         $"  -> "\\\"";
-        $%  -> "\\%";
-        $_  -> "\\_";
         $\\ -> "\\\\";
         _ -> C
      end || C <- S].

but I think it's not right way.

Another troubles was with "CREATE INDEX".
I got mysql's error "Specified key was too long".
I found such problem at http://bugs.mysql.com/bug.php?id=6604  and did
changing of indexes size like in bug description:

- CREATE UNIQUE INDEX i_rosteru_user_jid   ON rosterusers(username, jid);

+ CREATE UNIQUE INDEX i_rosteru_user_jid   ON
rosterusers(username(75), jid(75));

Now it seems all work ok, but I'll make more tests during next couple of days.

--
Regards,
Oleg


More information about the ejabberd mailing list