You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An exception occurred while executing 'INSERT INTO "oc_mimetypes"("mimetype") VALUES(?)': ORA-01400: cannot insert NULL into ("OWNCLOUD6"."oc_mimetypes"."mimetype")
@DeepDiver1975 Oracle considers NULL and empty string equivalent (sometimes). What do you think about removing the empty mimetype, using 0 as a no-mimetype marker and a LEFT/RIGHT join?
@DeepDiver1975 Okay, there does not seem to be any joining involved. Everything seems to be handled by ./lib/private/files/cache/cache.php.
afischer@leonard:/var/www/projects/owncloud/core (master) $ grep "\*PREFIX\*mimetypes". -Ri
./lib/private/files/cache/backgroundwatcher.php: $sql = 'SELECT `id` FROM `*PREFIX*mimetypes` WHERE `mimetype` = ?';
./lib/private/files/cache/cache.php: $result = \OC_DB::executeAudited('INSERT INTO `*PREFIX*mimetypes`(`mimetype`) VALUES(?)', array($mime));
./lib/private/files/cache/cache.php: self::$mimetypeIds[$mime] = \OC_DB::insertid('*PREFIX*mimetypes');
./lib/private/files/cache/cache.php: $result = \OC_DB::executeAudited('SELECT `id`, `mimetype` FROM `*PREFIX*mimetypes`', array());
./apps/files_sharing/lib/share/folder.php: $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*mimetypes` WHERE `mimetype` = ?');
The mimetype column of the mimetypes table is marked as NOT NULL, so empty string can not be used on Oracle. My suggestion would be not inserting the empty mimetype at all, but using hard-coded 0 instead. Does that make sense to you?
For me an empty mimetype ins inserted on mounting an SMB drive
hmm. Technically mount point is a directory, so it's related to mimetype detection rather than to Oracle DB engine :).
I'd suggest to prohibit empty mimetype at all.
@VicDeo So you would prefer to not download a remote HTTP file if the webserver does not specify a mimetype? Or what would be the expected behaviour in this case?
I think it is not detected properly on oC side.
It's true that remote server is not obliged to provide a mimetype but we can detect it if needed once transfer is complete.
Activity
VicDeo commentedon Oct 22, 2013
@DeepDiver1975
I noticed that there is an empty mimetype:
might be related
bantu commentedon Oct 23, 2013
@DeepDiver1975 Any more details for reproduction?
DeepDiver1975 commentedon Oct 23, 2013
For me an empty mimetype ins inserted on mounting an SMB drive
This is an Oracle fix only bug @butonic THX
bantu commentedon Oct 24, 2013
@DeepDiver1975 Oracle considers NULL and empty string equivalent (sometimes). What do you think about removing the empty mimetype, using 0 as a no-mimetype marker and a LEFT/RIGHT join?
bantu commentedon Oct 24, 2013
@DeepDiver1975 Okay, there does not seem to be any joining involved. Everything seems to be handled by
./lib/private/files/cache/cache.php.The mimetype column of the mimetypes table is marked as NOT NULL, so empty string can not be used on Oracle. My suggestion would be not inserting the empty mimetype at all, but using hard-coded 0 instead. Does that make sense to you?
bantu commentedon Oct 24, 2013
-1is returned in case an empty mimetype is tried to insert on Oracle. I am not sure what that signals. It probably should be turned into a constant.VicDeo commentedon Oct 24, 2013
hmm. Technically mount point is a directory, so it's related to mimetype detection rather than to Oracle DB engine :).
I'd suggest to prohibit empty mimetype at all.
As a dirty hack - replace it with space 🔬
bantu commentedon Oct 24, 2013
@VicDeo So you would prefer to not download a remote HTTP file if the webserver does not specify a mimetype? Or what would be the expected behaviour in this case?
VicDeo commentedon Oct 24, 2013
I think it is not detected properly on oC side.
It's true that remote server is not obliged to provide a mimetype but we can detect it if needed once transfer is complete.
bantu commentedon Oct 24, 2013
@VicDeo Maybe mimetype detection should fall back to octet-stream. At least that seems to be what the file command does.