Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
03e7fc31
Commit
03e7fc31
authored
Oct 30, 2002
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
date and time fields now have charset arg in constructor
my_charset_latin1
parent
b43876b9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
29 deletions
+39
-29
include/m_ctype.h
include/m_ctype.h
+1
-0
sql/field.cc
sql/field.cc
+5
-5
sql/field.h
sql/field.h
+17
-17
sql/item_timefunc.h
sql/item_timefunc.h
+11
-7
strings/ctype.c
strings/ctype.c
+5
-0
No files found.
include/m_ctype.h
View file @
03e7fc31
...
@@ -118,6 +118,7 @@ typedef struct charset_info_st
...
@@ -118,6 +118,7 @@ typedef struct charset_info_st
extern
CHARSET_INFO
*
my_charset_bin
;
extern
CHARSET_INFO
*
my_charset_bin
;
extern
CHARSET_INFO
*
my_charset_latin1
;
extern
CHARSET_INFO
*
default_charset_info
;
extern
CHARSET_INFO
*
default_charset_info
;
extern
CHARSET_INFO
*
system_charset_info
;
extern
CHARSET_INFO
*
system_charset_info
;
extern
CHARSET_INFO
*
all_charsets
[
256
];
extern
CHARSET_INFO
*
all_charsets
[
256
];
...
...
sql/field.cc
View file @
03e7fc31
...
@@ -5283,19 +5283,19 @@ Field *make_field(char *ptr, uint32 field_length,
...
@@ -5283,19 +5283,19 @@ Field *make_field(char *ptr, uint32 field_length,
unireg_check
,
field_name
,
table
);
unireg_check
,
field_name
,
table
);
case
FIELD_TYPE_DATE
:
case
FIELD_TYPE_DATE
:
return
new
Field_date
(
ptr
,
null_pos
,
null_bit
,
return
new
Field_date
(
ptr
,
null_pos
,
null_bit
,
unireg_check
,
field_name
,
table
);
unireg_check
,
field_name
,
table
,
field_charset
);
case
FIELD_TYPE_NEWDATE
:
case
FIELD_TYPE_NEWDATE
:
return
new
Field_newdate
(
ptr
,
null_pos
,
null_bit
,
return
new
Field_newdate
(
ptr
,
null_pos
,
null_bit
,
unireg_check
,
field_name
,
table
);
unireg_check
,
field_name
,
table
,
field_charset
);
case
FIELD_TYPE_TIME
:
case
FIELD_TYPE_TIME
:
return
new
Field_time
(
ptr
,
null_pos
,
null_bit
,
return
new
Field_time
(
ptr
,
null_pos
,
null_bit
,
unireg_check
,
field_name
,
table
);
unireg_check
,
field_name
,
table
,
field_charset
);
case
FIELD_TYPE_DATETIME
:
case
FIELD_TYPE_DATETIME
:
return
new
Field_datetime
(
ptr
,
null_pos
,
null_bit
,
return
new
Field_datetime
(
ptr
,
null_pos
,
null_bit
,
unireg_check
,
field_name
,
table
);
unireg_check
,
field_name
,
table
,
field_charset
);
case
FIELD_TYPE_NULL
:
case
FIELD_TYPE_NULL
:
default:
// Impossible (Wrong version)
default:
// Impossible (Wrong version)
return
new
Field_null
(
ptr
,
field_length
,
unireg_check
,
field_name
,
table
);
return
new
Field_null
(
ptr
,
field_length
,
unireg_check
,
field_name
,
table
,
field_charset
);
}
}
return
0
;
// Impossible (Wrong version)
return
0
;
// Impossible (Wrong version)
}
}
...
...
sql/field.h
View file @
03e7fc31
...
@@ -528,9 +528,9 @@ class Field_null :public Field_str {
...
@@ -528,9 +528,9 @@ class Field_null :public Field_str {
public:
public:
Field_null
(
char
*
ptr_arg
,
uint32
len_arg
,
Field_null
(
char
*
ptr_arg
,
uint32
len_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
struct
st_table
*
table_arg
)
struct
st_table
*
table_arg
,
CHARSET_INFO
*
cs
)
:
Field_str
(
ptr_arg
,
len_arg
,
null
,
1
,
:
Field_str
(
ptr_arg
,
len_arg
,
null
,
1
,
unireg_check_arg
,
field_name_arg
,
table_arg
,
default_charset_info
)
unireg_check_arg
,
field_name_arg
,
table_arg
,
cs
)
{}
{}
enum_field_types
type
()
const
{
return
FIELD_TYPE_NULL
;}
enum_field_types
type
()
const
{
return
FIELD_TYPE_NULL
;}
int
store
(
const
char
*
to
,
uint
length
,
CHARSET_INFO
*
cs
)
{
null
[
0
]
=
1
;
return
0
;
}
int
store
(
const
char
*
to
,
uint
length
,
CHARSET_INFO
*
cs
)
{
null
[
0
]
=
1
;
return
0
;
}
...
@@ -544,7 +544,7 @@ public:
...
@@ -544,7 +544,7 @@ public:
int
cmp
(
const
char
*
a
,
const
char
*
b
)
{
return
0
;}
int
cmp
(
const
char
*
a
,
const
char
*
b
)
{
return
0
;}
void
sort_string
(
char
*
buff
,
uint
length
)
{}
void
sort_string
(
char
*
buff
,
uint
length
)
{}
uint32
pack_length
()
const
{
return
0
;
}
uint32
pack_length
()
const
{
return
0
;
}
void
sql_type
(
String
&
str
)
const
{
str
.
set
(
"null"
,
4
,
default_charset_info
);
}
void
sql_type
(
String
&
str
)
const
{
str
.
set
(
"null"
,
4
,
my_thd_charset
);
}
uint
size_of
()
const
{
return
sizeof
(
*
this
);
}
uint
size_of
()
const
{
return
sizeof
(
*
this
);
}
};
};
...
@@ -615,14 +615,14 @@ class Field_date :public Field_str {
...
@@ -615,14 +615,14 @@ class Field_date :public Field_str {
public:
public:
Field_date
(
char
*
ptr_arg
,
uchar
*
null_ptr_arg
,
uchar
null_bit_arg
,
Field_date
(
char
*
ptr_arg
,
uchar
*
null_ptr_arg
,
uchar
null_bit_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
struct
st_table
*
table_arg
)
struct
st_table
*
table_arg
,
CHARSET_INFO
*
cs
)
:
Field_str
(
ptr_arg
,
10
,
null_ptr_arg
,
null_bit_arg
,
:
Field_str
(
ptr_arg
,
10
,
null_ptr_arg
,
null_bit_arg
,
unireg_check_arg
,
field_name_arg
,
table_arg
,
default_charset_info
)
unireg_check_arg
,
field_name_arg
,
table_arg
,
cs
)
{}
{}
Field_date
(
bool
maybe_null_arg
,
const
char
*
field_name_arg
,
Field_date
(
bool
maybe_null_arg
,
const
char
*
field_name_arg
,
struct
st_table
*
table_arg
)
struct
st_table
*
table_arg
,
CHARSET_INFO
*
cs
)
:
Field_str
((
char
*
)
0
,
10
,
maybe_null_arg
?
(
uchar
*
)
""
:
0
,
0
,
:
Field_str
((
char
*
)
0
,
10
,
maybe_null_arg
?
(
uchar
*
)
""
:
0
,
0
,
NONE
,
field_name_arg
,
table_arg
,
default_charset_info
)
{}
NONE
,
field_name_arg
,
table_arg
,
cs
)
{}
enum_field_types
type
()
const
{
return
FIELD_TYPE_DATE
;}
enum_field_types
type
()
const
{
return
FIELD_TYPE_DATE
;}
enum
ha_base_keytype
key_type
()
const
{
return
HA_KEYTYPE_ULONG_INT
;
}
enum
ha_base_keytype
key_type
()
const
{
return
HA_KEYTYPE_ULONG_INT
;
}
enum
Item_result
cmp_type
()
const
{
return
INT_RESULT
;
}
enum
Item_result
cmp_type
()
const
{
return
INT_RESULT
;
}
...
@@ -645,9 +645,9 @@ class Field_newdate :public Field_str {
...
@@ -645,9 +645,9 @@ class Field_newdate :public Field_str {
public:
public:
Field_newdate
(
char
*
ptr_arg
,
uchar
*
null_ptr_arg
,
uchar
null_bit_arg
,
Field_newdate
(
char
*
ptr_arg
,
uchar
*
null_ptr_arg
,
uchar
null_bit_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
struct
st_table
*
table_arg
)
struct
st_table
*
table_arg
,
CHARSET_INFO
*
cs
)
:
Field_str
(
ptr_arg
,
10
,
null_ptr_arg
,
null_bit_arg
,
:
Field_str
(
ptr_arg
,
10
,
null_ptr_arg
,
null_bit_arg
,
unireg_check_arg
,
field_name_arg
,
table_arg
,
default_charset_info
)
unireg_check_arg
,
field_name_arg
,
table_arg
,
cs
)
{}
{}
enum_field_types
type
()
const
{
return
FIELD_TYPE_DATE
;}
enum_field_types
type
()
const
{
return
FIELD_TYPE_DATE
;}
enum_field_types
real_type
()
const
{
return
FIELD_TYPE_NEWDATE
;
}
enum_field_types
real_type
()
const
{
return
FIELD_TYPE_NEWDATE
;
}
...
@@ -676,14 +676,14 @@ class Field_time :public Field_str {
...
@@ -676,14 +676,14 @@ class Field_time :public Field_str {
public:
public:
Field_time
(
char
*
ptr_arg
,
uchar
*
null_ptr_arg
,
uchar
null_bit_arg
,
Field_time
(
char
*
ptr_arg
,
uchar
*
null_ptr_arg
,
uchar
null_bit_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
struct
st_table
*
table_arg
)
struct
st_table
*
table_arg
,
CHARSET_INFO
*
cs
)
:
Field_str
(
ptr_arg
,
8
,
null_ptr_arg
,
null_bit_arg
,
:
Field_str
(
ptr_arg
,
8
,
null_ptr_arg
,
null_bit_arg
,
unireg_check_arg
,
field_name_arg
,
table_arg
,
default_charset_info
)
unireg_check_arg
,
field_name_arg
,
table_arg
,
cs
)
{}
{}
Field_time
(
bool
maybe_null_arg
,
const
char
*
field_name_arg
,
Field_time
(
bool
maybe_null_arg
,
const
char
*
field_name_arg
,
struct
st_table
*
table_arg
)
struct
st_table
*
table_arg
,
CHARSET_INFO
*
cs
)
:
Field_str
((
char
*
)
0
,
8
,
maybe_null_arg
?
(
uchar
*
)
""
:
0
,
0
,
:
Field_str
((
char
*
)
0
,
8
,
maybe_null_arg
?
(
uchar
*
)
""
:
0
,
0
,
NONE
,
field_name_arg
,
table_arg
,
default_charset_info
)
{}
NONE
,
field_name_arg
,
table_arg
,
cs
)
{}
enum_field_types
type
()
const
{
return
FIELD_TYPE_TIME
;}
enum_field_types
type
()
const
{
return
FIELD_TYPE_TIME
;}
enum
ha_base_keytype
key_type
()
const
{
return
HA_KEYTYPE_INT24
;
}
enum
ha_base_keytype
key_type
()
const
{
return
HA_KEYTYPE_INT24
;
}
enum
Item_result
cmp_type
()
const
{
return
INT_RESULT
;
}
enum
Item_result
cmp_type
()
const
{
return
INT_RESULT
;
}
...
@@ -708,14 +708,14 @@ class Field_datetime :public Field_str {
...
@@ -708,14 +708,14 @@ class Field_datetime :public Field_str {
public:
public:
Field_datetime
(
char
*
ptr_arg
,
uchar
*
null_ptr_arg
,
uchar
null_bit_arg
,
Field_datetime
(
char
*
ptr_arg
,
uchar
*
null_ptr_arg
,
uchar
null_bit_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
enum
utype
unireg_check_arg
,
const
char
*
field_name_arg
,
struct
st_table
*
table_arg
)
struct
st_table
*
table_arg
,
CHARSET_INFO
*
cs
)
:
Field_str
(
ptr_arg
,
19
,
null_ptr_arg
,
null_bit_arg
,
:
Field_str
(
ptr_arg
,
19
,
null_ptr_arg
,
null_bit_arg
,
unireg_check_arg
,
field_name_arg
,
table_arg
,
default_charset_info
)
unireg_check_arg
,
field_name_arg
,
table_arg
,
cs
)
{}
{}
Field_datetime
(
bool
maybe_null_arg
,
const
char
*
field_name_arg
,
Field_datetime
(
bool
maybe_null_arg
,
const
char
*
field_name_arg
,
struct
st_table
*
table_arg
)
struct
st_table
*
table_arg
,
CHARSET_INFO
*
cs
)
:
Field_str
((
char
*
)
0
,
19
,
maybe_null_arg
?
(
uchar
*
)
""
:
0
,
0
,
:
Field_str
((
char
*
)
0
,
19
,
maybe_null_arg
?
(
uchar
*
)
""
:
0
,
0
,
NONE
,
field_name_arg
,
table_arg
,
default_charset_info
)
{}
NONE
,
field_name_arg
,
table_arg
,
cs
)
{}
enum_field_types
type
()
const
{
return
FIELD_TYPE_DATETIME
;}
enum_field_types
type
()
const
{
return
FIELD_TYPE_DATETIME
;}
#ifdef HAVE_LONG_LONG
#ifdef HAVE_LONG_LONG
enum
ha_base_keytype
key_type
()
const
{
return
HA_KEYTYPE_ULONGLONG
;
}
enum
ha_base_keytype
key_type
()
const
{
return
HA_KEYTYPE_ULONGLONG
;
}
...
...
sql/item_timefunc.h
View file @
03e7fc31
...
@@ -243,7 +243,7 @@ public:
...
@@ -243,7 +243,7 @@ public:
}
}
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
{
return
(
!
t_arg
)
?
result_field
:
new
Field_date
(
maybe_null
,
name
,
t_arg
);
return
(
!
t_arg
)
?
result_field
:
new
Field_date
(
maybe_null
,
name
,
t_arg
,
my_thd_charset
);
}
}
};
};
...
@@ -261,7 +261,7 @@ public:
...
@@ -261,7 +261,7 @@ public:
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
{
return
(
!
t_arg
)
?
result_field
:
new
Field_datetime
(
maybe_null
,
name
,
return
(
!
t_arg
)
?
result_field
:
new
Field_datetime
(
maybe_null
,
name
,
t_arg
);
t_arg
,
my_thd_charset
);
}
}
};
};
...
@@ -287,7 +287,8 @@ public:
...
@@ -287,7 +287,8 @@ public:
}
}
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
{
return
(
!
t_arg
)
?
result_field
:
new
Field_time
(
maybe_null
,
name
,
t_arg
);
return
(
!
t_arg
)
?
result_field
:
new
Field_time
(
maybe_null
,
name
,
t_arg
,
my_thd_charset
);
}
}
};
};
...
@@ -379,7 +380,8 @@ public:
...
@@ -379,7 +380,8 @@ public:
}
}
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
{
return
(
!
t_arg
)
?
result_field
:
new
Field_time
(
maybe_null
,
name
,
t_arg
);
return
(
!
t_arg
)
?
result_field
:
new
Field_time
(
maybe_null
,
name
,
t_arg
,
my_thd_charset
);
}
}
};
};
...
@@ -443,7 +445,8 @@ public:
...
@@ -443,7 +445,8 @@ public:
}
}
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
{
return
(
!
t_arg
)
?
result_field
:
new
Field_date
(
maybe_null
,
name
,
t_arg
);
return
(
!
t_arg
)
?
result_field
:
new
Field_date
(
maybe_null
,
name
,
t_arg
,
my_thd_charset
);
}
}
};
};
...
@@ -458,7 +461,8 @@ public:
...
@@ -458,7 +461,8 @@ public:
}
}
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
{
return
(
!
t_arg
)
?
result_field
:
new
Field_time
(
maybe_null
,
name
,
t_arg
);
return
(
!
t_arg
)
?
result_field
:
new
Field_time
(
maybe_null
,
name
,
t_arg
,
my_thd_charset
);
}
}
};
};
...
@@ -474,6 +478,6 @@ public:
...
@@ -474,6 +478,6 @@ public:
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
{
return
(
!
t_arg
)
?
result_field
:
new
Field_datetime
(
maybe_null
,
name
,
return
(
!
t_arg
)
?
result_field
:
new
Field_datetime
(
maybe_null
,
name
,
t_arg
);
t_arg
,
my_thd_charset
);
}
}
};
};
strings/ctype.c
View file @
03e7fc31
...
@@ -20,6 +20,10 @@
...
@@ -20,6 +20,10 @@
#include <m_string.h>
#include <m_string.h>
#endif
#endif
#ifndef HAVE_CHARSET_latin1
#define HAVE_CHARSET_latin1
#endif
#if defined(HAVE_CHARSET_latin1)||defined(HAVE_CHARSET_latin1_de)||\
#if defined(HAVE_CHARSET_latin1)||defined(HAVE_CHARSET_latin1_de)||\
defined(HAVE_CHARSET_danish)||defined(HAVE_CHARSET_german1)
defined(HAVE_CHARSET_danish)||defined(HAVE_CHARSET_german1)
...
@@ -3651,6 +3655,7 @@ static CHARSET_INFO compiled_charsets[] = {
...
@@ -3651,6 +3655,7 @@ static CHARSET_INFO compiled_charsets[] = {
};
};
CHARSET_INFO
*
my_charset_latin1
=
&
compiled_charsets
[
0
];
CHARSET_INFO
*
all_charsets
[
256
];
CHARSET_INFO
*
all_charsets
[
256
];
CHARSET_INFO
*
default_charset_info
=
&
compiled_charsets
[
0
];
CHARSET_INFO
*
default_charset_info
=
&
compiled_charsets
[
0
];
CHARSET_INFO
*
system_charset_info
=
&
compiled_charsets
[
0
];
CHARSET_INFO
*
system_charset_info
=
&
compiled_charsets
[
0
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment