On 2/28/07, ciccettino@stripped <ciccettino@stripped> wrote:
>
> Hi,
> I'm getting mad with some aspects that aren't so clear just reading the
> source code and the documentation available (to me, MySQL
> Internals documentation could and should be more comprehensive, deepening
> many other aspects and details; is there any project
> documentation as uml and so on?): I hope you can explain some of these and
> help me figure out the point from where to start my
> modifications.
Except for your desire for UML, I know how you feel. I tend to consult
ha_federated.{cc,h}, ha_innodb.{cc,h} and ha_ndbcluster.{cc,h} when I want
to figure out how things are supposed to work.
First of all, in a table struct what are "fields" and what are "records"?
> How do they relates with each other and with the so named
> "items"? Which of these structures stores a row?
'fields' corresponds to the columns in a row, and some methods and variables
from it can be used to determine the location within record[0] for a column.
record[0] is the buffer used to pass the row between storage engines and the
SQL layer
I am not sure what record[i] for i > 0 does.
Secondly: I'm analyzing sql_insert.cc, just as a starting point. I've
> followed all the code from "mysql_insert" on and I've found that the
> junction point with the handler is the instruction: "write_record(thd,
> table ,&info)"; in fact, following "write_record()", it can be found
> that in the simpliest of the situations, the handler instruction invoked
> is ha_write_row(table->record[0]), which seems to just write out a
> buffer (the "table->record[0]" that I didn't understand what precisely is)
> in a custom way that depends on the storage engine. Now my main
> question is: if, as said, a blob is stored in memory as a lenght and a
> pointer (in a blob field there is the "String value" which stores
> the real data, isn't it?), how and where the pointed data is inserted in
> the buffer that then the handler writes out (when, of course, the
> storage engine supports blobs)?
> I hope it was all almost clear. Thanks.
> Manu
For SELECT statements, when the storage engine returns a row with a LOB
column, a pointer is returned in record[0] that points to the LOB and the
memory that is pointed to is owned and managed by the storage engine
instance.
Naviga e telefona senza limiti con Tiscali
> Scopri le promozioni Tiscali adsl: navighi e telefoni senza canone Telecom
>
> http://abbonati.tiscali.it/adsl/
>
>
> --
> MySQL Internals Mailing List
> For list archives: http://lists.mysql.com/internals
> To unsubscribe:
> http://lists.mysql.com/internals?unsub=1
>
>
--
Mark Callaghan
mcallaghan@stripped