I tried Mediawiki 1.17.0 and set common database for all upload files by variable $wgSharedUploadDBname, and uploading file got warnings and fatal error.
Warning: mysql_real_escape_string() expects parameter 2 to be resource, null given in /includes/db/DatabaseMysql.php on line 316 Warning: mysql_query() expects parameter 2 to be resource, null given in /includes/db/DatabaseMysql.php on line 23 Warning: mysql_query() expects parameter 2 to be resource, null given in /includes/db/DatabaseMysql.php on line 23 Warning: mysql_real_escape_string() expects parameter 2 to be resource, null given in /includes/db/DatabaseMysql.php on line 316 Warning: mysql_real_escape_string() expects parameter 2 to be resource, null given in /includes/db/DatabaseMysql.php on line 316 Warning: mysql_query() expects parameter 2 to be resource, null given in /includes/db/DatabaseMysql.php on line 23 Warning: mysql_real_escape_string() expects parameter 2 to be resource, null given in /includes/db/DatabaseMysql.php on line 316 Warning: mysql_query() expects parameter 2 to be resource, null given in /includes/db/DatabaseMysql.php on line 23 Warning: Invalid argument supplied for foreach() in /includes/filerepo/LocalRepo.php on line 169 Fatal error: Call to a member function free() on a non-object in /includes/filerepo/LocalRepo.php on line 172
So if you need $wgSharedUploadDBname, it is better not to use Mediawiki 1.17.0, yet use the older version 1.16.5.
Here's the fix:
http://www.mediawiki.org/wiki/Thread:Project:Support_desk/$wgUseSharedUploads_causes_trouble