@@ -66,8 +66,9 @@ typedef struct st_mysql_xid MYSQL_XID;
66
66
#define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */
67
67
#define MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */
68
68
#define MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */
69
- #define MYSQL_REPLICATION_PLUGIN 5 /* The replication plugin type */
70
- #define MYSQL_MAX_PLUGIN_TYPE_NUM 6 /* The number of plugin types */
69
+ #define MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */
70
+ #define MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */
71
+ #define MYSQL_MAX_PLUGIN_TYPE_NUM 7 /* The number of plugin types */
71
72
72
73
/* We use the following strings to define licenses for plugins */
73
74
#define PLUGIN_LICENSE_PROPRIETARY 0
@@ -403,205 +404,43 @@ struct st_mysql_plugin
403
404
/* ************************************************************************
404
405
API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN)
405
406
*/
407
+ #include " plugin_ftparser.h"
406
408
407
- #define MYSQL_FTPARSER_INTERFACE_VERSION 0x0100
408
-
409
- /* Parsing modes. Set in MYSQL_FTPARSER_PARAM::mode */
410
- enum enum_ftparser_mode
411
- {
412
- /*
413
- Fast and simple mode. This mode is used for indexing, and natural
414
- language queries.
415
-
416
- The parser is expected to return only those words that go into the
417
- index. Stopwords or too short/long words should not be returned. The
418
- 'boolean_info' argument of mysql_add_word() does not have to be set.
419
- */
420
- MYSQL_FTPARSER_SIMPLE_MODE= 0 ,
421
-
422
- /*
423
- Parse with stopwords mode. This mode is used in boolean searches for
424
- "phrase matching."
425
-
426
- The parser is not allowed to ignore words in this mode. Every word
427
- should be returned, including stopwords and words that are too short
428
- or long. The 'boolean_info' argument of mysql_add_word() does not
429
- have to be set.
409
+ /* ************************************************************************
410
+ API for Storage Engine plugin. (MYSQL_DAEMON_PLUGIN)
430
411
*/
431
- MYSQL_FTPARSER_WITH_STOPWORDS= 1 ,
432
412
433
- /*
434
- Parse in boolean mode. This mode is used to parse a boolean query string.
435
-
436
- The parser should provide a valid MYSQL_FTPARSER_BOOLEAN_INFO
437
- structure in the 'boolean_info' argument to mysql_add_word().
438
- Usually that means that the parser should recognize boolean operators
439
- in the parsing stream and set appropriate fields in
440
- MYSQL_FTPARSER_BOOLEAN_INFO structure accordingly. As for
441
- MYSQL_FTPARSER_WITH_STOPWORDS mode, no word should be ignored.
442
- Instead, use FT_TOKEN_STOPWORD for the token type of such a word.
443
- */
444
- MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2
445
- };
413
+ /* handlertons of different MySQL releases are incompatible */
414
+ #define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8 )
446
415
447
416
/*
448
- Token types for boolean mode searching (used for the type member of
449
- MYSQL_FTPARSER_BOOLEAN_INFO struct)
450
-
451
- FT_TOKEN_EOF: End of data.
452
- FT_TOKEN_WORD: Regular word.
453
- FT_TOKEN_LEFT_PAREN: Left parenthesis (start of group/sub-expression).
454
- FT_TOKEN_RIGHT_PAREN: Right parenthesis (end of group/sub-expression).
455
- FT_TOKEN_STOPWORD: Stopword.
417
+ Here we define only the descriptor structure, that is referred from
418
+ st_mysql_plugin.
456
419
*/
457
420
458
- enum enum_ft_token_type
421
+ struct st_mysql_daemon
459
422
{
460
- FT_TOKEN_EOF= 0 ,
461
- FT_TOKEN_WORD= 1 ,
462
- FT_TOKEN_LEFT_PAREN= 2 ,
463
- FT_TOKEN_RIGHT_PAREN= 3 ,
464
- FT_TOKEN_STOPWORD= 4
423
+ int interface_version;
465
424
};
466
425
467
- /*
468
- This structure is used in boolean search mode only. It conveys
469
- boolean-mode metadata to the MySQL search engine for every word in
470
- the search query. A valid instance of this structure must be filled
471
- in by the plugin parser and passed as an argument in the call to
472
- mysql_add_word (the callback function in the MYSQL_FTPARSER_PARAM
473
- structure) when a query is parsed in boolean mode.
474
-
475
- type: The token type. Should be one of the enum_ft_token_type values.
476
-
477
- yesno: Whether the word must be present for a match to occur:
478
- >0 Must be present
479
- <0 Must not be present
480
- 0 Neither; the word is optional but its presence increases the relevance
481
- With the default settings of the ft_boolean_syntax system variable,
482
- >0 corresponds to the '+' operator, <0 corrresponds to the '-' operator,
483
- and 0 means neither operator was used.
484
-
485
- weight_adjust: A weighting factor that determines how much a match
486
- for the word counts. Positive values increase, negative - decrease the
487
- relative word's importance in the query.
488
-
489
- wasign: The sign of the word's weight in the query. If it's non-negative
490
- the match for the word will increase document relevance, if it's
491
- negative - decrease (the word becomes a "noise word", the less of it the
492
- better).
493
-
494
- trunc: Corresponds to the '*' operator in the default setting of the
495
- ft_boolean_syntax system variable.
496
- */
497
-
498
- typedef struct st_mysql_ftparser_boolean_info
499
- {
500
- enum enum_ft_token_type type;
501
- int yesno;
502
- int weight_adjust;
503
- char wasign;
504
- char trunc;
505
- /* These are parser state and must be removed. */
506
- char prev;
507
- char *quot;
508
- } MYSQL_FTPARSER_BOOLEAN_INFO;
509
-
510
- /*
511
- The following flag means that buffer with a string (document, word)
512
- may be overwritten by the caller before the end of the parsing (that is
513
- before st_mysql_ftparser::deinit() call). If one needs the string
514
- to survive between two successive calls of the parsing function, she
515
- needs to save a copy of it. The flag may be set by MySQL before calling
516
- st_mysql_ftparser::parse(), or it may be set by a plugin before calling
517
- st_mysql_ftparser_param::mysql_parse() or
518
- st_mysql_ftparser_param::mysql_add_word().
519
- */
520
- #define MYSQL_FTFLAGS_NEED_COPY 1
521
-
522
- /*
523
- An argument of the full-text parser plugin. This structure is
524
- filled in by MySQL server and passed to the parsing function of the
525
- plugin as an in/out parameter.
526
-
527
- mysql_parse: A pointer to the built-in parser implementation of the
528
- server. It's set by the server and can be used by the parser plugin
529
- to invoke the MySQL default parser. If plugin's role is to extract
530
- textual data from .doc, .pdf or .xml content, it might extract
531
- plaintext from the content, and then pass the text to the default
532
- MySQL parser to be parsed.
533
-
534
- mysql_add_word: A server callback to add a new word. When parsing
535
- a document, the server sets this to point at a function that adds
536
- the word to MySQL full-text index. When parsing a search query,
537
- this function will add the new word to the list of words to search
538
- for. The boolean_info argument can be NULL for all cases except
539
- when mode is MYSQL_FTPARSER_FULL_BOOLEAN_INFO.
540
426
541
- ftparser_state: A generic pointer. The plugin can set it to point
542
- to information to be used internally for its own purposes.
543
-
544
- mysql_ftparam: This is set by the server. It is used by MySQL functions
545
- called via mysql_parse() and mysql_add_word() callback. The plugin
546
- should not modify it.
547
-
548
- cs: Information about the character set of the document or query string.
549
-
550
- doc: A pointer to the document or query string to be parsed.
551
-
552
- length: Length of the document or query string, in bytes.
553
-
554
- flags: See MYSQL_FTFLAGS_* constants above.
555
-
556
- mode: The parsing mode. With boolean operators, with stopwords, or
557
- nothing. See enum_ftparser_mode above.
427
+ /* ************************************************************************
428
+ API for I_S plugin. (MYSQL_INFORMATION_SCHEMA_PLUGIN)
558
429
*/
559
430
560
- typedef struct st_mysql_ftparser_param
561
- {
562
- int (*mysql_parse)(struct st_mysql_ftparser_param *,
563
- char *doc, int doc_len);
564
- int (*mysql_add_word)(struct st_mysql_ftparser_param *,
565
- char *word, int word_len,
566
- MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
567
- void *ftparser_state;
568
- void *mysql_ftparam;
569
- struct charset_info_st *cs;
570
- char *doc;
571
- int length;
572
- int flags;
573
- enum enum_ftparser_mode mode;
574
- } MYSQL_FTPARSER_PARAM;
431
+ /* handlertons of different MySQL releases are incompatible */
432
+ #define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8 )
575
433
576
434
/*
577
- Full-text parser descriptor.
578
-
579
- interface_version is, e.g., MYSQL_FTPARSER_INTERFACE_VERSION.
580
- The parsing, initialization, and deinitialization functions are
581
- invoked per SQL statement for which the parser is used.
435
+ Here we define only the descriptor structure, that is referred from
436
+ st_mysql_plugin.
582
437
*/
583
438
584
- struct st_mysql_ftparser
439
+ struct st_mysql_information_schema
585
440
{
586
441
int interface_version;
587
- int (*parse)(MYSQL_FTPARSER_PARAM *param);
588
- int (*init)(MYSQL_FTPARSER_PARAM *param);
589
- int (*deinit)(MYSQL_FTPARSER_PARAM *param);
590
442
};
591
443
592
- /* ************************************************************************
593
- API for Storage Engine plugin. (MYSQL_DAEMON_PLUGIN)
594
- */
595
-
596
- /* handlertons of different MySQL releases are incompatible */
597
- #define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8 )
598
-
599
- /* ************************************************************************
600
- API for I_S plugin. (MYSQL_INFORMATION_SCHEMA_PLUGIN)
601
- */
602
-
603
- /* handlertons of different MySQL releases are incompatible */
604
- #define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8 )
605
444
606
445
/* ************************************************************************
607
446
API for Storage Engine plugin. (MYSQL_STORAGE_ENGINE_PLUGIN)
@@ -623,25 +462,6 @@ struct st_mysql_storage_engine
623
462
624
463
struct handlerton ;
625
464
626
- /*
627
- Here we define only the descriptor structure, that is referred from
628
- st_mysql_plugin.
629
- */
630
-
631
- struct st_mysql_daemon
632
- {
633
- int interface_version;
634
- };
635
-
636
- /*
637
- Here we define only the descriptor structure, that is referred from
638
- st_mysql_plugin.
639
- */
640
-
641
- struct st_mysql_information_schema
642
- {
643
- int interface_version;
644
- };
645
465
646
466
/*
647
467
API for Replication plugin. (MYSQL_REPLICATION_PLUGIN)
@@ -655,7 +475,7 @@ struct st_mysql_information_schema
655
475
int interface_version;
656
476
};
657
477
658
- /*
478
+ /* ************************************************************************
659
479
st_mysql_value struct for reading values from mysqld.
660
480
Used by server variables framework to parse user-provided values.
661
481
Will be used for arguments when implementing UDFs.
0 commit comments