summaryrefslogtreecommitdiff
path: root/storage/maria/ha_s3.h
blob: 0777debc8d81e26df323ea5df37b4178fd5f4fd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef HA_S3_INCLUDED
#define HA_S3_INCLUDED
/* Copyright (C) 2019 MariaDB Corppration AB

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; version 2 of the License.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the
   Free Software Foundation, Inc.
   51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/

#include "ha_maria.h"

class ha_s3 :public ha_maria
{
  enum alter_table_op
  { S3_NO_ALTER, S3_ALTER_TABLE, S3_ADD_PARTITION, S3_ADD_TMP_PARTITION };
  alter_table_op in_alter_table;
  S3_INFO *open_args;

public:
  ha_s3(handlerton *hton, TABLE_SHARE * table_arg);
  ~ha_s3() {}

  int create(const char *name, TABLE *table_arg,
             HA_CREATE_INFO *ha_create_info) final;
  int open(const char *name, int mode, uint open_flags) final;
  int write_row(const uchar *buf) final;
  int update_row(const uchar * old_data, const uchar * new_data) final
  {
    DBUG_ENTER("update_row");
    DBUG_RETURN(HA_ERR_WRONG_COMMAND);
  }
  int delete_row(const uchar * buf) final
  {
    DBUG_ENTER("delete_row");
    DBUG_RETURN(HA_ERR_WRONG_COMMAND);
  }
  int check(THD * thd, HA_CHECK_OPT * check_opt) final
  {
    DBUG_ENTER("delete_row");
    DBUG_RETURN(HA_ERR_WRONG_COMMAND);
  }
  int analyze(THD * thd, HA_CHECK_OPT * check_opt) final
  {
    DBUG_ENTER("analyze");
    DBUG_RETURN(HA_ERR_WRONG_COMMAND);
  }
  int repair(THD * thd, HA_CHECK_OPT * check_opt) final
  {
    DBUG_ENTER("repair");
    DBUG_RETURN(HA_ERR_WRONG_COMMAND);
  }
  int preload_keys(THD * thd, HA_CHECK_OPT * check_opt) final
  {
    DBUG_ENTER("preload_keys");
    DBUG_RETURN(HA_ERR_WRONG_COMMAND);
  }
  int external_lock(THD * thd, int lock_type) final;
  /*
    drop_table() is only used for internal temporary tables,
    not applicable for s3
  */
  void drop_table(const char *name) final
  {
  }
  int delete_table(const char *name) final;
  int rename_table(const char *from, const char *to) final;
  int discover_check_version() override;
  int rebind();
  S3_INFO *s3_open_args() final { return open_args; }
  void register_handler(MARIA_HA *file) final;
};
#endif /* HA_S3_INCLUDED */