Permalink
Browse files

This project is no longer maintained within PEAR CVS,

developement is now hosted on

  http://CodeGenerators.php-baustelle.de/

instead.


git-svn-id: http://svn.php.net/repository/pear/packages/CodeGen_MySQL_Plugin/trunk@235323 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
Hartmut Holzgraefe
Hartmut Holzgraefe committed May 10, 2007
1 parent e9e623d commit 3aa9c9362bae4e6397ebefaa1e1997e24e0969b6
Showing with 6 additions and 509 deletions.
  1. +6 −0 README
  2. +0 −8 docs/Makefile
  3. +0 −126 docs/examples/gzip_fulltext.xml
  4. +0 −42 docs/examples/is-example.xml
  5. +0 −52 docs/examples/minimal.xml
  6. +0 −281 docs/manual.xml
View
6 README
@@ -0,0 +1,6 @@
+This project is no longer maintained within PEAR CVS,
+developement is now hosted on
+
+ http://CodeGenerators.php-baustelle.de/
+
+instead.
View
@@ -1,8 +0,0 @@
-all: manual.html manual.pdf
-
-manual.html: manual.xml
- docbook2html -u manual.xml
-
-manual.pdf: manual.xml
- docbook2pdf manual.xml
-
@@ -1,126 +0,0 @@
-<?xml version="1.0"?>
-<plugin name="gzip_fulltext">
- <maintainer>
- <name>Hartmut Holzgraefe</name>
- <email>hartmut@mysql.com</email>
- </maintainer>
-
- <license>GPL</license>
-
- <release>
- <version>0.1</version>
- <date>2004-05-25</date>
- <state>beta</state>
- <notes>
- First working release
- </notes>
- </release>
-
- <deps>
- <src/>
- <header name="zlib.h"/>
- </deps>
-
- <fulltext name="gzip">
- <summary>A fulltext plugin to search on gzip COMPRESS()ed fields</summary>
-
- <parser>
- <code>
-<![CDATA[
- /* check for compress header to distinguish between compressed data
- and uncompressed search terms
- MySQL COMPRESS() stores the real data length in the first 4 bytes
- followed by the compressed data which starts with the two magic
- marker bytes 0x78, 0x9C
- */
- if ((param->length >= 6)
- && ((unsigned char)(param->doc[4]) == 0x78)
- && ((unsigned char)(param->doc[5]) == 0x9C)) {
- ulong real_size;
- char *real_doc;
- int result;
-
- /* calculate the real size and allocate memory */
- real_size = uint4korr(&param->length) & 0x3FFFFFFF;
- real_doc = malloc(real_size + 1);
- if (!real_doc) {
- return 1;
- }
-
- /* the following flag needs to be set as we uncompress
- to dynamic storage we free again right away */
- param->flags |= MYSQL_FTFLAGS_NEED_COPY;
-
- /* uncompress */
- result = uncompress((unsigned char*)real_doc, &real_size, (unsigned char *)(param->doc) + 4, param->length);
-
- if (result == Z_OK) {
- /* OK, pass on to default parser */
- result = param->mysql_parse(param, real_doc, real_size);
- } else {
- /* failure */
- result = 1;
- }
-
- /* cleanup, no leaks please */
- free(real_doc);
-
- return result;
- } else {
- /* uncompressed data is passed on right away */
- return param->mysql_parse(param, param->doc, param->length);
- }
-]]>
- </code>
- </parser>
-
- <test name="gzip_plugin">
- <!-- this test just checks for the plugins existance -->
- <code>
-SELECT PLUGIN_NAME, PLUGIN_STATUS,PLUGIN_TYPE,PLUGIN_LIBRARY FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME='gzip';
- </code>
- <result>
-PLUGIN_NAME PLUGIN_STATUS PLUGIN_TYPE PLUGIN_LIBRARY
-gzip ACTIVE FTPARSER gzip_fulltext.so
- </result>
- </test>
-
- <test name="gzip_fulltext">
- <!--
- this test creates a table using the new plugin,
- populates it with some text rows, both gzip compressed and plain text,
- and then checks the result of some full text queries, again using
- both compressed and uncompressed data
- -->
- <code>
---disable_warnings
-DROP TABLE IF EXISTS t1;
---ensable_warnings
-CREATE TABLE t1 (
- doc CHAR(100) DEFAULT NULL,
- FULLTEXT KEY `doc` (`doc`) WITH PARSER gzip
-) ENGINE=MyISAM DEFAULT CHARSET latin1;
-
-INSERT INTO t1 (doc) VALUES ('this is a fulltext parser test');
-INSERT INTO t1 (doc) VALUES (COMPRESS('this is a fulltext parser test'));
-INSERT INTO t1 (doc) VALUES ('the meaning of life, universe and all the rest');
-INSERT INTO t1 (doc) VALUES ('some dummy text');
-INSERT INTO t1 (doc) VALUES (COMPRESS('more dummy text'));
-
-SELECT COUNT(*) FROM t1 WHERE MATCH(doc) AGAINST('parser');
-SELECT COUNT(*) FROM t1 WHERE MATCH(doc) AGAINST(COMPRESS('parser'));
-SELECT COUNT(*) FROM t1 WHERE MATCH(doc) AGAINST(COMPRESS('universe'));
- </code>
- <result>
-COUNT(*)
-2
-COUNT(*)
-2
-COUNT(*)
-1
- </result>
- </test>
-
- </fulltext>
-
-</plugin>
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<plugin name="is_example">
- <maintainer>
- <name>Hartmut Holzgraefe</name>
- <email>hartmut@mysql.com</email>
- </maintainer>
-
- <license>GPL</license>
-
- <release>
- <version>0.1</version>
- <date>2006-04-27</date>
- <state>beta</state>
- <notes>
- First working release
- </notes>
- </release>
-
- <deps language="c++"/>
-
- <infoschema name="is_dummy">
- <summary>minimal example plugin</summary>
-
- <field name="FOOBAR" type="LONG"/>
-
- <code>
-<?data
- TABLE* table= tables->table;
-
- table->field[FIELD_FOOBAR]->store(23);
- schema_table_store_record(thd, table);
-
- table->field[FIELD_FOOBAR]->store(23);
- schema_table_store_record(thd, table);
-
- return 0;
-?>
- </code>
-
- </infoschema>
-
-</plugin>
View
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-<plugin name="minimal">
- <maintainer>
- <name>Hartmut Holzgraefe</name>
- <email>hartmut@mysql.com</email>
- </maintainer>
-
- <license>GPL</license>
-
- <release>
- <version>0.1</version>
- <date>2004-05-25</date>
- <state>beta</state>
- <notes>
- First working release
- </notes>
- </release>
-
- <deps>
- <src/>
- </deps>
-
- <fulltext name="dummy">
- <summary>minimal example plugin</summary>
-
- <statusvar type="int" name="_int" init="42"/>
- <statusvar type="long" name="_long" init="-1"/>
- <statusvar type="longlong" name="_llong" init="12000000000LL"/>
- <statusvar type="char" name="_char" init="'q'"/>
- <statusvar type="char_ptr" name="_char_ptr" init='"hello world!"'/>
- <statusvar type="array" name="dummy">
- <statusvar type="int" name="foo" init="23"/>
- <statusvar type="int" name="bar" init="42"/>
- </statusvar>
-
- <parser>
- <code>
-<![CDATA[
- char *doc;
- int result;
-
- doc = strndup(param->doc, param->length);
- result = param->mysql_parse(param, param->doc, param->length);
- free(doc);
-
- return result;
-]]>
- </code>
- </parser>
- </fulltext>
-
-</plugin>
Oops, something went wrong.

0 comments on commit 3aa9c93

Please sign in to comment.