custom user tables supported in SharDB plugin?

Ok, looking into this, I found a little bug in the tables function (beginning on line 1088) in the db.php script file that comes with SharDB.

It was this bit of code that was the problem (starting on line 1114 of db.php):

if ( isset( $tables['users'] ) ) {
    if( defined( 'CUSTOM_USER_TABLE' ) ) 
        $pre_tables['users'] = CUSTOM_USER_TABLE;
    if ( defined( 'CUSTOM_USER_META_TABLE' ) ) 
        $pre_tables['usermeta'] = CUSTOM_USER_META_TABLE;
}

See, it does check before it returns the tables list to see if CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE are defined, and overwrites the default values if they are. However the check was not running in the first place because of the isset( $tables['users'] ) check on line 114. $tables is an array of table names, ‘users’ is one of the values in the array, so $tables[‘users’] is never set.

So change line 114 to:

if ( isset( $pre_tables['users'] ) )

and voila. You’re all set

(I’m gonna go find the plugin author now and report the bug!)