<div dir="ltr"><br><div class="gmail_quote">On Tue, Jan 17, 2012 at 15:19, <span dir="ltr"><<a href="mailto:michael.vancanneyt@wisa.be">michael.vancanneyt@wisa.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
<br>
On Tue, 17 Jan 2012, Mattias Gaertner wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<a href="mailto:michael.vancanneyt@wisa.be" target="_blank">michael.vancanneyt@wisa.be</a> hat am 17. Januar 2012 um 13:28 geschrieben:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Tue, 17 Jan 2012, Mattias Gaertner wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I tried connecting to a mysql 5.5 database and used the fpc unit<br>
</blockquote></blockquote>
mysql51.<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There are only examples for 3 and 4, so I started with testdb4.pp and<br>
adapted it.<br>
It turned out that the MYSQL record is missing some new fields, so the<br>
mysql_init overwrites the memory behind.<br>
After adding some dummy bytes at the end it worked nice.<br>
<br>
Is there a better way?<br>
</blockquote>
<br>
Yes, convert the mysql 5.5. headers. Or adapt the 5.1 headers to match<br>
</blockquote>
the<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
5.5 specs.<br>
</blockquote>
<br>
<br>
;)<br>
</blockquote>
<br></div>
You asked for a better way. not a faster :-)</blockquote><div><br>The best way imho is not to use this "db" toy. Unless you do not have a way to avoid it, and then "it sucks to be you" ;)<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That is how we bring it up-to-date whenever a new MySQL version appears.<br>
</blockquote>
<br>
<br>
I only found mysql51 headers. Are there some newer ones?<br>
</blockquote>
<br></div>
Not to my knowlegde.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I would like my program to still run when the next small upgrade comes.<br>
</blockquote>
<br></div>
We cannot guarantee that. You even can't guarantee that in C. An upgrade of<br>
the mysql library may break your perfectly running program. (I have known it to happen for a client of mine)<br>
<br>
Most people don't notice this, since all distributions recompile everything that depends on MySQL from scratch anyway. But for FPC, the case is different.</blockquote><div><br>MySQL is "deprecated", and there are several open source projects that uses the same code base, but try to provide better support (<a href="http://mariadb.org/">http://mariadb.org/</a> for example).<br>
The problem is, that most people know "MySQL". so here is the problem you describe :(<br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
As<br>
far as I can see new things are only added at the end, so adding some dummy<br>
bytes for "future extensions" may help here. Is this wishful thinking?<br>
</blockquote>
<br></div>
No, because sometimes they change the size or position of a field, and then resolve it with macros in C. Since we need the correct size and<br>
position this does not guarantee you solve everything. They also change the number of arguments to calls and change the export symbols, again they mask this with C macros.<br>
<br>
In short: You never know, hence you must upgrade the headers.<br>
<br>
This mess is why I urge people not to use MySQL. Their API is not stable.<br>
e.g. Firebird's API has been stable for the last 12 years, but features are<br>
nevertheless added all the time.<br>
<br>
So: upgrade the 5.1 to 5.5, and I'll add it in FPC and create a 5.5 mysql<br>
connection object as soon as I have received the upgraded headers.<div class="HOEnZb"><div class="h5"><br>
<br>
Michael.<br>
______________________________<u></u>_________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.<u></u>org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/<u></u>mailman/listinfo/fpc-pascal</a><br>
</div></div></blockquote></div><br></div>