1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Simplified 'wrong xxx name' error messages by introducing 'general' ER_WRONG_NAME error

Cleaned up (and disabled part of) date/time/datetime format patch. One can't anymore change default read/write date/time/formats.
This is becasue the non standard datetime formats can't be compared as strings and MySQL does still a lot of datetime comparisons as strings
Changed flag argument to str_to_TIME() and get_date() from bool to uint
Removed THD from str_to_xxxx functions and Item class.
Fixed core dump when doing --print-defaults
Move some common string functions to strfunc.cc
Dates as strings are now of type my_charset_bin instead of default_charset()
Introduce IDENT_QUOTED to not have to create an extra copy of simple identifiers (all chars < 128)
Removed xxx_FORMAT_TYPE enums and replaced them with the old TIMESTAMP_xxx enums
Renamed some TIMESTAMP_xxx enums to more appropriate names
Use defines instead of integers for date/time/datetime string lengths
Added to build system and use the new my_strtoll10() function.
This commit is contained in:
monty@narttu.mysql.fi
2003-11-03 14:01:59 +02:00
parent d9eca0e127
commit a444a3449f
81 changed files with 2644 additions and 1643 deletions

View File

@@ -20,15 +20,19 @@
struct st_table;
class Field;
typedef struct st_date_format { /* How to print date */
uint pos[6]; /* Positions to YY.MM.DD HH:MM:SS */
} DATE_FORMAT;
typedef struct lex_string {
char *str;
uint length;
} LEX_STRING;
typedef struct st_date_time_format {
uchar positions[8];
char time_separator; /* Separator between hour and minute */
uint flag; /* For future */
LEX_STRING format;
} DATE_TIME_FORMAT;
typedef struct st_datetime_format {
byte dt_pos[8];
char *format;
uint format_length;
} DATETIME_FORMAT;
typedef struct st_keyfile_info { /* used with ha_info() */
byte ref[MAX_REFLENGTH]; /* Pointer to current row */
@@ -115,8 +119,17 @@ typedef struct st_read_record { /* Parameter to read_record */
bool print_error, ignore_not_found_rows;
} READ_RECORD;
enum timestamp_type { TIMESTAMP_NONE, WRONG_TIMESTAMP_FULL, TIMESTAMP_DATE, TIMESTAMP_FULL,
TIMESTAMP_TIME};
enum timestamp_type
{
TIMESTAMP_NONE= -2, TIMESTAMP_DATETIME_ERROR= -1,
TIMESTAMP_DATE= 0, TIMESTAMP_DATETIME= 1, TIMESTAMP_TIME= 2
};
/* Parameters to str_to_TIME */
#define TIME_FUZZY_DATE 1
#define TIME_DATETIME_ONLY 2
typedef struct st_time {
uint year,month,day,hour,minute,second;
@@ -125,12 +138,21 @@ typedef struct st_time {
timestamp_type time_type;
} TIME;
typedef struct {
long year,month,day,hour,minute,second,second_part;
bool neg;
} INTERVAL;
typedef struct st_known_date_time_format {
const char *format_name;
const char *date_format;
const char *datetime_format;
const char *time_format;
} KNOWN_DATE_TIME_FORMAT;
enum SHOW_TYPE
{
SHOW_UNDEF,
@@ -168,11 +190,6 @@ typedef struct show_var_st {
} SHOW_VAR;
typedef struct lex_string {
char *str;
uint length;
} LEX_STRING;
typedef struct st_lex_user {
LEX_STRING user, host, password;
} LEX_USER;