[ewiki] Re: Bug in Binary Upload/DB Layer
- From: Mario Salzer <mario@xxxxxxxxxxxxx>
- To: ewiki@xxxxxxxxxxxxx
- Date: Thu, 29 Jan 2004 16:01:42 +0100
> I think we've got a bug in the signatures of our database layer
> functions, ewiki_database() and ewiki_database_mysql() both accept args
> by value. while nomally I would be in favor of that, this results in
> trippling the memory requirement.
True in between _database() and _database_real() we could pass the
$data array using a PHP pointer. But throughout ewiki this won't work
without additional effort.
So eventually we could just ini_set() the PHP option to allow pass-by-ref
when calling a function, but do this only where necessary(??)
> I don't think it's related, but for large pages (above 750K) something
> near here is causing an apache crash on my test server even with all the
> relevant variables maxed out. (memory allowed, file upload size, post
> variable size, and EWIKI_UPLOAD_MAXSIZE all set to 40MB). Any ideas
> welcome.
Wow, 40MB is of course not possible. Neither PHP can handle this nor can't
a MySQL db receive that much data using a sql92 conform insert. Even if
it could, that much data can't be fetched back into the application using
a sql select then.
The only solution to this is to write a sophisticated upload/download
extension and store data outside of the database. This would be similar
to plugins/db/binary_store, but hack into a lot more hooks and needed
even to replace the whole ewiki_binary() on occasion. (I have not begun
to make such a plugin.)
But even then I wouldn't recommend letting http uploads exceed the size
of a few megabytes.
mario
- References:
- [ewiki] WikiMarkup
- From: Daniel P. Stasinski
- [ewiki] Re: WikiMarkup
- From: Mario Salzer
- [ewiki] Bug in Binary Upload/DB Layer
- From: Andy Fundinger
Other related posts:
- » [ewiki] Bug in Binary Upload/DB Layer
- » [ewiki] Re: Bug in Binary Upload/DB Layer
- [ewiki] WikiMarkup
- From: Daniel P. Stasinski
- [ewiki] Re: WikiMarkup
- From: Mario Salzer
- [ewiki] Bug in Binary Upload/DB Layer
- From: Andy Fundinger