Added support for multiple statements (needed for stored procedures)
Every now and then somebody asks for how to connect (or execute a query) and have the form still working. In order to answer to this question i've created a little helper unit ..
For the source code have a look at:
Please note that this version is under strict GPL - any previous permission to use direct mysql in your non-gpl projects does NOT apply to this release, and direct mysql 1.2.1 should ONLY be used as GPL.
Every so often someone would ask how to upload an image to mysql or how to download a song from mysql. I had decided to create a simple helper package that should make this things easyer, and 4 tiny functions have been created ...
For a demo have a look at:
The new minor version is finally out ... Altough not many changes compared to the previous one, it is higly recommended to upgrade it.
The new version has now an infinite timeout, returns default value for fields when describing a table, and makes a distinction between empty and NULL strings. On top of this thread safety can now be enabled, such as more than one thread can use the same client to access the server.
It fixes an overflow error accidentally introduced in the previous version(s).... read more
The new Mysql 4.1.x secure password protocol is now available for testing. If you are interested in using it please do send me an e-mail request.
02/03/2003 - before strdispose(pac) in line 689 there should be a:
if pac<>packet1 then
In the unit uMysqlNet in the implementation of
function TMysqlNet.net_real_write there is a possible memory leak. The fix is:
lines 638 and 639
pac:=stralloc(len1); //get some memory ???
should be replaced by:
should be removed as:
pac:=b;... read more
The patch from download section would be compatible with the latest zeos version and it require the following change:
override the function MySqlToDelphiTypeDesc in ZDirMySql.pas (from the patch) with the one from the 5.4 implementation.
What happends is on slow network it does not get a chance to flush the tcp/ip stack and it will give an error - which will be considered as a server lost error. This is a result of not using the blocking mode when writing to the socket.
there are 3 fixes:
1) increase RETRY_COUNT in uMysqlCT
2) wherever you find in uMysqlNet "< RETRY_COUNT" replace it with "<= RETRY_COUNT"
3)the "real" fix is in unit uMysqlNet:
in net_real_write you will find this line 679:
if (fvio.vio_should_retry) then //should retry?... read more
The new zeos patch enables you to switch between libmysql.dll and direct-mysql objects with just a single compiler directive.
There is also a sample patch on how to add ssl support to zeos (curently untested).
I've just discovered an interesting bug ...
When running a query eg: "select afield from atable" and you get a recordset like: "one","","two","three" you will see only the first row.
The fix is in read_rows function while
which should be:
while not (( byte(cp) = 254) and (pkt_len = 1)) do
while ( byte(cp) <> 254) and (pkt_len <> 1) do... read more
A new week a new month a new minor version.
The fixes include:
- unix sockets (named pipes on linux) were left out of the initialization code
- error handling is better/faster
- new connect timedout works on both connect and read .. so no more stalled application when reading a large dataset and you lose connection to server. The connect is very fast now, especially when typing in wrong host information :) ( if you set a timeout of 10 seconds it will take no longer than 10 seconds - compared to previous version where it took 10 seconds + about 10 more).
I will upload it tomorrow so stick around for it,
I've noticed that the application is frozen when you execute a large query .. anyone would be interested to have a threaded version?
As you all got used .. there will be a patch for Zeos in order to use a TDataset descendant and direct-mysql objects. Currently the patch it is being tested and will be released later on today or tomorrow.
There has been created a new mailing list for mysql and delphi matters (not only this direct mysql stuff). Everyone is wellcomed to subscribe.
I'm currently working on compression for the objects for both this compilers, so there will be a release pretty soon. If anyone is anxious to get it sooner drop me an email and i will send you the sources in current stage.
ps: if anyone knows .. array typecasting in vp (eg var anint:integer;
type anarr:array of byte;
anarr(anint) <- if anyone knows how to sort this out) please do let me know asap.
2) if you know the object files format for free pascal ... i would love to know if $L directive works.
Altough it does not return complete errors code and details about them ...it is working ..
So .. happy mysql-ing!
Finally i had finished the objects for direct working with mysql.
I will upload a full demo and the code somewhere during next few days.