Ignore:
Timestamp:
Feb 12, 2002, 8:05:28 AM (24 years ago)
Author:
bird
Message:

Updated to 3.23.42-rel.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/database/mysql/mysql_com.h

    r1936 r7882  
    1 /* Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
    2    This file is public domain and comes with NO WARRANTY of any kind */
     1/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
     2   
     3   This library is free software; you can redistribute it and/or
     4   modify it under the terms of the GNU Library General Public
     5   License as published by the Free Software Foundation; either
     6   version 2 of the License, or (at your option) any later version.
     7   
     8   This library is distributed in the hope that it will be useful,
     9   but WITHOUT ANY WARRANTY; without even the implied warranty of
     10   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     11   Library General Public License for more details.
     12   
     13   You should have received a copy of the GNU Library General Public
     14   License along with this library; if not, write to the Free
     15   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
     16   MA 02111-1307, USA */
    317
    418/*
     
    822#ifndef _mysql_com_h
    923#define _mysql_com_h
    10 #ifdef  __cplusplus
    11 extern "C" {
    12 #endif
     24
    1325
    1426#define NAME_LEN        64              /* Field/table name length */
    1527#define HOSTNAME_LENGTH 60
    1628#define USERNAME_LENGTH 16
     29#define SERVER_VERSION_LENGTH 60
    1730
    1831#define LOCAL_HOST      "localhost"
    1932#define LOCAL_HOST_NAMEDPIPE "."
    2033
    21 #define MYSQL_PORT      3306            /* Alloced by ISI for MySQL */
    22 #define MYSQL_UNIX_ADDR "/tmp/mysql.sock"
    23 #if defined(__EMX__) || defined(__OS2__)
    24 #undef MYSQL_UNIX_ADDR
    25 #define MYSQL_OS2_ADDR "\\socket\\MySQL"
    26 #define MYSQL_UNIX_ADDR MYSQL_OS2_ADDR
    27 #endif
    28 #ifdef WIN32
     34#if defined(__WIN__) && !defined( _CUSTOMCONFIG_)
    2935#define MYSQL_NAMEDPIPE "MySQL"
    3036#define MYSQL_SERVICENAME "MySql"
    31 #endif
     37#endif /* __WIN__ */
    3238
    3339enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY,
     
    3541                          COM_SHUTDOWN,COM_STATISTICS,
    3642                          COM_PROCESS_INFO,COM_CONNECT,COM_PROCESS_KILL,
    37                           COM_DEBUG,COM_PING,COM_TIME,COM_DELAYED_INSERT};
     43                          COM_DEBUG,COM_PING,COM_TIME,COM_DELAYED_INSERT,
     44                          COM_CHANGE_USER, COM_BINLOG_DUMP,
     45                          COM_TABLE_DUMP, COM_CONNECT_OUT};
    3846
    3947#define NOT_NULL_FLAG   1               /* Field can't be NULL */
     
    5058#define TIMESTAMP_FLAG  1024            /* Field is a timestamp */
    5159#define SET_FLAG        2048            /* field is a set */
     60#define NUM_FLAG        32768           /* Field is num (for clients) */
    5261#define PART_KEY_FLAG   16384           /* Intern; Part of some key */
    5362#define GROUP_FLAG      32768           /* Intern: Group field */
     
    5968#define REFRESH_HOSTS           8       /* Flush host cache */
    6069#define REFRESH_STATUS          16      /* Flush status variables */
     70#define REFRESH_THREADS         32      /* Flush status variables */
     71#define REFRESH_SLAVE           64      /* Reset master info and restart slave
     72                                           thread */
     73#define REFRESH_MASTER          128     /* Remove all bin logs in the index
     74                                           and truncate the index */
     75
     76/* The following can't be set with mysql_refresh() */
     77#define REFRESH_READ_LOCK       16384   /* Lock tables for read */
    6178#define REFRESH_FAST            32768   /* Intern flag */
    6279
     
    6683#define CLIENT_CONNECT_WITH_DB  8       /* One can specify db on connect */
    6784#define CLIENT_NO_SCHEMA        16      /* Don't allow database.table.column */
    68 #define CLIENT_COMPRESS         32      /* Can use compression protcol */
     85#define CLIENT_COMPRESS         32      /* Can use compression protocol */
    6986#define CLIENT_ODBC             64      /* Odbc client */
    7087#define CLIENT_LOCAL_FILES      128     /* Can use LOAD DATA LOCAL */
    7188#define CLIENT_IGNORE_SPACE     256     /* Ignore spaces before '(' */
     89#define CLIENT_CHANGE_USER      512     /* Support the mysql_change_user() */
     90#define CLIENT_INTERACTIVE      1024    /* This is an interactive client */
     91#define CLIENT_SSL              2048     /* Switch to SSL after handshake */
     92#define CLIENT_IGNORE_SIGPIPE   4096     /* IGNORE sigpipes */
     93#define CLIENT_TRANSACTIONS     8192    /* Client knows about transactions */
     94
     95#define SERVER_STATUS_IN_TRANS  1       /* Transaction has started */
     96#define SERVER_STATUS_AUTOCOMMIT 2      /* Server in auto_commit mode */
    7297
    7398#define MYSQL_ERRMSG_SIZE       200
     
    76101#define NET_WAIT_TIMEOUT        8*60*60         /* Wait for new query */
    77102
    78 enum enum_net_type { NET_TYPE_TCPIP, NET_TYPE_SOCKET, NET_TYPE_NAMEDPIPE };
     103#ifndef Vio_defined
     104#define Vio_defined
     105#ifdef HAVE_VIO
     106class Vio;                                      /* Fill Vio class in C++ */
     107#else
     108struct st_vio;                                  /* Only C */
     109typedef struct st_vio Vio;
     110#endif
     111#endif
    79112
    80113typedef struct st_net {
    81   enum enum_net_type nettype;
    82 #ifdef WIN32
    83   HANDLE hPipe;
    84 #endif
    85   my_socket fd;
     114  Vio* vio;
     115  my_socket fd;                                 /* For Perl DBI/dbd */
    86116  int fcntl;
    87117  unsigned char *buff,*buff_end,*write_pos,*read_pos;
    88118  char last_error[MYSQL_ERRMSG_SIZE];
    89119  unsigned int last_errno,max_packet,timeout,pkt_nr;
    90   my_bool error,return_errno,compress;
    91 
     120  unsigned char error;
     121  my_bool return_errno,compress;
     122  my_bool no_send_ok; /* needed if we are doing several
     123   queries in one command ( as in LOAD TABLE ... FROM MASTER ),
     124   and do not want to confuse the client with OK at the wrong time
     125                      */
    92126  unsigned long remain_in_buf,length, buf_length, where_b;
    93   my_bool more;
     127  unsigned int *return_status;
     128  unsigned char reading_or_writing;
    94129  char save_char;
    95130} NET;
     
    123158#define net_new_transaction(net) ((net)->pkt_nr=0)
    124159
    125 int     my_net_init(NET *net,  enum enum_net_type nettype, my_socket fd,
    126                     void *);
     160int     my_net_init(NET *net, Vio* vio);
    127161void    net_end(NET *net);
    128162void    net_clear(NET *net);
     
    169203  /* Prototypes to password functions */
    170204
     205#ifdef __cplusplus
     206extern "C" {
     207#endif
     208 
    171209void randominit(struct rand_struct *,unsigned long seed1,
    172210                unsigned long seed2);
     
    174212void make_scrambled_password(char *to,const char *password);
    175213void get_salt_from_password(unsigned long *res,const char *password);
     214void make_password_from_salt(char *to, unsigned long *hash_res);
    176215char *scramble(char *to,const char *message,const char *password,
    177216               my_bool old_ver);
     
    180219char *get_tty_password(char *opt_message);
    181220void hash_password(unsigned long *result, const char *password);
     221#ifdef __cplusplus
     222}
     223#endif
    182224
    183225/* Some other useful functions */
     
    189231#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */
    190232
    191 #ifdef WIN32
     233#ifdef __WIN__
    192234#define socket_errno WSAGetLastError()
     235#elif defined(OS2)
     236#define socket_errno sock_errno()
    193237#else
    194238#define socket_errno errno
    195239#endif
    196240
    197 #ifdef  __cplusplus
    198 }
    199 #endif
    200 #endif
     241#endif
Note: See TracChangeset for help on using the changeset viewer.