$11 GRAYBYTE WORDPRESS FILE MANAGER $25

SERVER : in-mum-web1330.main-hosting.eu #1 SMP Mon Feb 10 22:45:17 UTC 2025
SERVER IP : 147.79.69.41 | ADMIN IP 216.73.216.215
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/usr/include/mysql/server/

HOME
Current File : /usr/include/mysql/server//ma_dyncol.h
/* Copyright (c) 2011, Monty Program Ab
   Copyright (c) 2011, Oleksandr Byelkin

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are
   met:

   1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.

   2. Redistributions in binary form must the following disclaimer in
     the documentation and/or other materials provided with the
     distribution.

   THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY
   EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   SUCH DAMAGE.
*/

#ifndef ma_dyncol_h
#define ma_dyncol_h
#ifdef __cplusplus
extern "C" {
#endif

#include <decimal.h>
#include <my_decimal_limits.h>
#include <mysql_time.h>

#ifndef _my_sys_h
typedef struct st_dynamic_string
{
    char *str;
    size_t length,max_length,alloc_increment;
} DYNAMIC_STRING;
#endif

#ifndef MY_GLOBAL_INCLUDED
struct st_mysql_lex_string
{
  char *str;
  size_t length;
};
typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
typedef struct st_mysql_lex_string LEX_STRING;
#endif

/*
  Limits of implementation
*/
#define MAX_TOTAL_NAME_LENGTH 65535
#define MAX_NAME_LENGTH (MAX_TOTAL_NAME_LENGTH/4)

/* NO and OK is the same used just to show semantics */
#define ER_DYNCOL_NO ER_DYNCOL_OK

#ifdef HAVE_CHARSET_utf8mb4
#define DYNCOL_UTF (&my_charset_utf8mb4_general_ci)
#else
#define DYNCOL_UTF (&my_charset_utf8mb3_general_ci)
#endif

/* escape json strings */
#define DYNCOL_JSON_ESC ((char)1)

enum enum_dyncol_func_result
{
  ER_DYNCOL_OK= 0,
  ER_DYNCOL_YES= 1,                /* For functions returning 0/1 */
  ER_DYNCOL_FORMAT= -1,            /* Wrong format of the encoded string */
  ER_DYNCOL_LIMIT=  -2,            /* Some limit reached */
  ER_DYNCOL_RESOURCE= -3,          /* Out of resources */
  ER_DYNCOL_DATA= -4,              /* Incorrect input data */
  ER_DYNCOL_UNKNOWN_CHARSET= -5,   /* Unknown character set */
  ER_DYNCOL_TRUNCATED= 2           /* OK, but data was truncated */
};

typedef DYNAMIC_STRING DYNAMIC_COLUMN;

enum enum_dynamic_column_type
{
  DYN_COL_NULL= 0,
  DYN_COL_INT,
  DYN_COL_UINT,
  DYN_COL_DOUBLE,
  DYN_COL_STRING,
  DYN_COL_DECIMAL,
  DYN_COL_DATETIME,
  DYN_COL_DATE,
  DYN_COL_TIME,
  DYN_COL_DYNCOL
};

typedef enum enum_dynamic_column_type DYNAMIC_COLUMN_TYPE;

struct st_dynamic_column_value
{
  DYNAMIC_COLUMN_TYPE type;
  union
  {
    long long long_value;
    unsigned long long ulong_value;
    double double_value;
    struct {
      MYSQL_LEX_STRING value;
      CHARSET_INFO *charset;
    } string;
    struct {
      decimal_digit_t buffer[DECIMAL_BUFF_LENGTH];
      decimal_t value;
    } decimal;
    MYSQL_TIME time_value;
  } x;
};

typedef struct st_dynamic_column_value DYNAMIC_COLUMN_VALUE;

#ifdef MADYNCOL_DEPRECATED
enum enum_dyncol_func_result
dynamic_column_create(DYNAMIC_COLUMN *str,
                      uint column_nr, DYNAMIC_COLUMN_VALUE *value);

enum enum_dyncol_func_result
dynamic_column_create_many(DYNAMIC_COLUMN *str,
                           uint column_count,
                           uint *column_numbers,
                           DYNAMIC_COLUMN_VALUE *values);
enum enum_dyncol_func_result
dynamic_column_update(DYNAMIC_COLUMN *org, uint column_nr,
                      DYNAMIC_COLUMN_VALUE *value);
enum enum_dyncol_func_result
dynamic_column_update_many(DYNAMIC_COLUMN *str,
                           uint add_column_count,
                           uint *column_numbers,
                           DYNAMIC_COLUMN_VALUE *values);

enum enum_dyncol_func_result
dynamic_column_exists(DYNAMIC_COLUMN *org, uint column_nr);

enum enum_dyncol_func_result
dynamic_column_list(DYNAMIC_COLUMN *org, DYNAMIC_ARRAY *array_of_uint);

enum enum_dyncol_func_result
dynamic_column_get(DYNAMIC_COLUMN *org, uint column_nr,
                   DYNAMIC_COLUMN_VALUE *store_it_here);
#endif

/* new functions */
enum enum_dyncol_func_result
mariadb_dyncol_create_many_num(DYNAMIC_COLUMN *str,
                               uint column_count,
                               uint *column_numbers,
                               DYNAMIC_COLUMN_VALUE *values,
                               my_bool new_string);
enum enum_dyncol_func_result
mariadb_dyncol_create_many_named(DYNAMIC_COLUMN *str,
                                 uint column_count,
                                 MYSQL_LEX_STRING *column_keys,
                                 DYNAMIC_COLUMN_VALUE *values,
                                 my_bool new_string);


enum enum_dyncol_func_result
mariadb_dyncol_update_many_num(DYNAMIC_COLUMN *str,
                               uint add_column_count,
                               uint *column_keys,
                               DYNAMIC_COLUMN_VALUE *values);
enum enum_dyncol_func_result
mariadb_dyncol_update_many_named(DYNAMIC_COLUMN *str,
                                 uint add_column_count,
                                 MYSQL_LEX_STRING *column_keys,
                                 DYNAMIC_COLUMN_VALUE *values);


enum enum_dyncol_func_result
mariadb_dyncol_exists_num(DYNAMIC_COLUMN *org, uint column_nr);
enum enum_dyncol_func_result
mariadb_dyncol_exists_named(DYNAMIC_COLUMN *str, MYSQL_LEX_STRING *name);

/* List of not NULL columns */
enum enum_dyncol_func_result
mariadb_dyncol_list_num(DYNAMIC_COLUMN *str, uint *count, uint **nums);
enum enum_dyncol_func_result
mariadb_dyncol_list_named(DYNAMIC_COLUMN *str, uint *count,
                          MYSQL_LEX_STRING **names);

/*
   if the column do not exists it is NULL
*/
enum enum_dyncol_func_result
mariadb_dyncol_get_num(DYNAMIC_COLUMN *org, uint column_nr,
                       DYNAMIC_COLUMN_VALUE *store_it_here);
enum enum_dyncol_func_result
mariadb_dyncol_get_named(DYNAMIC_COLUMN *str, MYSQL_LEX_STRING *name,
                         DYNAMIC_COLUMN_VALUE *store_it_here);

my_bool mariadb_dyncol_has_names(DYNAMIC_COLUMN *str);

enum enum_dyncol_func_result
mariadb_dyncol_check(DYNAMIC_COLUMN *str);

enum enum_dyncol_func_result
mariadb_dyncol_json(DYNAMIC_COLUMN *str, DYNAMIC_STRING *json);

#define mariadb_dyncol_init(A) memset((A), 0, sizeof(*(A)))
void mariadb_dyncol_free(DYNAMIC_COLUMN *str);

/* conversion of values to 3 base types */
enum enum_dyncol_func_result
mariadb_dyncol_val_str(DYNAMIC_STRING *str, DYNAMIC_COLUMN_VALUE *val,
                       CHARSET_INFO *cs, my_bool quote);
enum enum_dyncol_func_result
mariadb_dyncol_val_long(longlong *ll, DYNAMIC_COLUMN_VALUE *val);
enum enum_dyncol_func_result
mariadb_dyncol_val_double(double *dbl, DYNAMIC_COLUMN_VALUE *val);


enum enum_dyncol_func_result
mariadb_dyncol_unpack(DYNAMIC_COLUMN *str,
                      uint *count,
                      MYSQL_LEX_STRING **names, DYNAMIC_COLUMN_VALUE **vals);

void mariadb_dyncol_unpack_free(MYSQL_LEX_STRING *names,
                                DYNAMIC_COLUMN_VALUE *vals);

int mariadb_dyncol_column_cmp_named(const MYSQL_LEX_STRING *s1,
                                    const MYSQL_LEX_STRING *s2);

enum enum_dyncol_func_result
mariadb_dyncol_column_count(DYNAMIC_COLUMN *str, uint *column_count);

#define mariadb_dyncol_value_init(V) (V)->type= DYN_COL_NULL

/*
  Prepare value for using as decimal
*/
void mariadb_dyncol_prepare_decimal(DYNAMIC_COLUMN_VALUE *value);

#ifdef __cplusplus
}
#endif
#endif

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
4 Jul 2024 10.38 PM
root / root
0755
mysql
--
4 Jul 2024 10.38 PM
root / root
0755
private
--
4 Jul 2024 10.38 PM
root / root
0755
big_endian.h
4.399 KB
5 Jun 2024 5.31 PM
root / root
0644
byte_order_generic.h
5.119 KB
5 Jun 2024 5.31 PM
root / root
0644
byte_order_generic_x86.h
4.182 KB
5 Jun 2024 5.31 PM
root / root
0644
byte_order_generic_x86_64.h
4.032 KB
5 Jun 2024 5.31 PM
root / root
0644
decimal.h
4.806 KB
5 Jun 2024 5.31 PM
root / root
0644
errmsg.h
4.306 KB
5 Jun 2024 5.31 PM
root / root
0644
governor.h
0.187 KB
5 Jun 2024 5.31 PM
root / root
0644
handler_ername.h
4.399 KB
5 Jun 2024 5.31 PM
root / root
0644
handler_state.h
0.74 KB
5 Jun 2024 5.31 PM
root / root
0644
json_lib.h
13.811 KB
5 Jun 2024 5.31 PM
root / root
0644
keycache.h
8.62 KB
5 Jun 2024 5.31 PM
root / root
0644
little_endian.h
3.488 KB
5 Jun 2024 5.31 PM
root / root
0644
m_ctype.h
68.417 KB
5 Jun 2024 5.31 PM
root / root
0644
m_string.h
9.489 KB
5 Jun 2024 5.31 PM
root / root
0644
ma_dyncol.h
7.856 KB
5 Jun 2024 5.31 PM
root / root
0644
mariadb_capi_rename.h
3.125 KB
5 Jun 2024 5.31 PM
root / root
0644
my_alloc.h
2.019 KB
5 Jun 2024 5.31 PM
root / root
0644
my_alloca.h
1.397 KB
5 Jun 2024 5.31 PM
root / root
0644
my_attribute.h
2.677 KB
5 Jun 2024 5.31 PM
root / root
0644
my_byteorder.h
2.005 KB
5 Jun 2024 5.31 PM
root / root
0644
my_compiler.h
5.143 KB
5 Jun 2024 5.31 PM
root / root
0644
my_config.h
14.195 KB
5 Jun 2024 5.31 PM
root / root
0644
my_dbug.h
9.684 KB
5 Jun 2024 5.31 PM
root / root
0644
my_decimal_limits.h
2.025 KB
5 Jun 2024 5.31 PM
root / root
0644
my_dir.h
3.796 KB
5 Jun 2024 5.31 PM
root / root
0644
my_getopt.h
5.473 KB
5 Jun 2024 5.31 PM
root / root
0644
my_global.h
32.477 KB
5 Jun 2024 5.31 PM
root / root
0644
my_list.h
1.471 KB
5 Jun 2024 5.31 PM
root / root
0644
my_net.h
1.981 KB
5 Jun 2024 5.31 PM
root / root
0644
my_pthread.h
27.416 KB
5 Jun 2024 5.31 PM
root / root
0644
my_sys.h
47.664 KB
5 Jun 2024 5.31 PM
root / root
0644
my_valgrind.h
4.438 KB
5 Jun 2024 5.31 PM
root / root
0644
my_xml.h
2.766 KB
5 Jun 2024 5.31 PM
root / root
0644
mysql.h
39.108 KB
5 Jun 2024 5.31 PM
root / root
0644
mysql_com.h
30.154 KB
5 Jun 2024 5.31 PM
root / root
0644
mysql_com_server.h
1.282 KB
5 Jun 2024 5.31 PM
root / root
0644
mysql_embed.h
1.098 KB
5 Jun 2024 5.31 PM
root / root
0644
mysql_time.h
2.363 KB
5 Jun 2024 5.31 PM
root / root
0644
mysql_version.h
1.258 KB
5 Jun 2024 5.31 PM
root / root
0644
mysqld_ername.h
125.48 KB
5 Jun 2024 5.31 PM
root / root
0644
mysqld_error.h
47.25 KB
5 Jun 2024 5.31 PM
root / root
0644
pack.h
1.079 KB
5 Jun 2024 5.31 PM
root / root
0644
sql_common.h
5.145 KB
5 Jun 2024 5.31 PM
root / root
0644
sql_state.h
14.604 KB
5 Jun 2024 5.31 PM
root / root
0644
sslopt-case.h
1.498 KB
5 Jun 2024 5.31 PM
root / root
0644
sslopt-longopts.h
2.593 KB
5 Jun 2024 5.31 PM
root / root
0644
sslopt-vars.h
1.372 KB
5 Jun 2024 5.31 PM
root / root
0644
typelib.h
2.34 KB
5 Jun 2024 5.31 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF