Databases Reference
In-Depth Information
From all of the above we provide only one piece of "variable" information—a
number of rows in the table:
int ha_static_text::info(uint flag)
{
if (flag & HA_STATUS_VARIABLE)
stats.records = static_text_rows;
return 0;
}
That's it! Our irst storage engine plugin is complete. Now we can compile it, install
it, and start playing with it.
This example could be easily extended to generate random data. We could then
populate another table by creating a similar schema, setting the number of rows
required, and doing:
mysql> insert into t1 select * from t2;
where t1 is a normal table and t2 is using our random data generator table.
Summary
In this chapter, we have seen the basics of creating a new storage engine plugin and
have written a simple read-only engine. We will use this knowledge as a basis for
more advanced engines in the following chapters.
 
Search WWH ::




Custom Search