1 /*****************************************************************************
2 
3 Copyright (c) 2016, Percona Inc. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation; version 2 of the License.
8 
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16 
17 *****************************************************************************/
18 
19 #ifndef SQL_ZIP_DICT_INCLUDED
20 #define SQL_ZIP_DICT_INCLUDED
21 
22 #include "my_global.h"
23 
24 class THD;
25 
26 /**
27   Creates a new compression dictionary with the specified data.
28 
29   @param thd                        thread descriptor.
30   @param name                       compression dictionary name
31   @param name_len                   compression dictionary name length
32   @param data                       compression dictionary data
33   @param data_len                   compression dictionary data length
34   @param if_not_exists              "IF NOT EXISTS" flag
35 
36   @return Completion status
37   @retval 0                                       Success
38   @retval ER_ILLEGAL_HA_CREATE_OPTION             SE does not support
39                                                   compression dictionaries
40   @retval ER_COMPRESSION_DICTIONARY_NAME_TOO_LONG Dictionary name is too long
41   @retval ER_COMPRESSION_DICTIONARY_DATA_TOO_LONG Dictionary data is too long
42   @retval ER_COMPRESSION_DICTIONARY_EXISTS        Dictionary with such name
43                                                   already exists
44   @retval ER_READ_ONLY_MODE                       Forbidden in read-only mode
45   @retval ER_ILLEGAL_HA                           Forbidden when fake
46                                                   changes enabled
47   @retval ER_UNKNOWN_ERROR                        Unknown error
48 */
49 int mysql_create_zip_dict(THD* thd, const char* name, ulong name_len,
50   const char* data, ulong data_len, bool if_not_exists);
51 
52 /**
53   Deletes a compression dictionary.
54 
55   @param thd                        thread descriptor.
56   @param name                       compression dictionary name
57   @param name_len                   compression dictionary name length
58   @param if_exists                  "IF EXISTS" flag
59 
60   @return Completion status
61   @retval 0                                        Success
62   @retval ER_ILLEGAL_HA_CREATE_OPTION              SE does not support
63                                                    compression dictionaries
64   @retval ER_COMPRESSION_DICTIONARY_DOES_NOT_EXIST Dictionary with such name
65                                                    does not exist
66   @retval ER_COMPRESSION_DICTIONARY_IS_REFERENCED  Dictictionary is still in
67                                                    use
68   @retval ER_READ_ONLY_MODE                        Forbidden in read-only
69                                                    mode
70   @retval ER_ILLEGAL_HA                            Forbidden when fake
71                                                    changes enabled
72   @retval ER_UNKNOWN_ERROR                         Unknown error
73 */
74 int mysql_drop_zip_dict(THD* thd, const char* name, ulong name_len,
75   bool if_exists);
76 
77 #endif /* SQL_ZIP_DICT_INCLUDED */
78