This simple storage engine plugin, called
STATIC_TEXT, supports only read-only tables. It defines two system variables, which we use to change its behavior. The first variable is
@@static_text_text, which specifies the text returned in
VARCHAR fields ("Hello world!" by default) and the second variable is
@@static_text_rows, which specifies the number of rows to return (the default is 3). When a table in this storage engine is queried, any
VARCHAR field will contain the contents of
@@static_text_text and any integer field will contain the current row number:
mysql> install plugin STATIC_TEXT soname 'ha_text.so'; Query OK, 0 rows affected (0.03 sec) mysql> create table t1 (a int, b varchar(50)) engine=static_text; Query ...