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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
40f828d5
Commit
40f828d5
authored
Dec 11, 2002
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some system_charset_info and default_charset_info were replaced by my_charset_latin1
parent
34033b93
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
23 deletions
+15
-23
sql/convert.cc
sql/convert.cc
+1
-11
sql/field.cc
sql/field.cc
+9
-9
sql/field_conv.cc
sql/field_conv.cc
+5
-3
No files found.
sql/convert.cc
View file @
40f828d5
...
...
@@ -433,17 +433,7 @@ CONVERT *get_convert_set(const char *name)
{
for
(
CONVERT
**
ptr
=
convert_tables
;
*
ptr
;
ptr
++
)
{
/*
BAR TODO: Monty's comments:
Why is this using system_charset_info ?
Isn't the character-set string given in the users default charset?
Please add a TODO note to the code that this has to be fixed when the user
will be able to cast strings to different character sets...
The current code will also not work if/when we introduce support for
16 bit characters...
(I know that there is a LOT of changes to do if we ever want do this...)
*/
if
(
!
my_strcasecmp
(
system_charset_info
,(
*
ptr
)
->
name
,
name
))
if
(
!
my_strcasecmp
(
my_charset_latin1
,(
*
ptr
)
->
name
,
name
))
return
(
*
ptr
);
}
return
0
;
...
...
sql/field.cc
View file @
40f828d5
...
...
@@ -290,23 +290,23 @@ void Field::store_time(TIME *ltime,timestamp_type type)
char
buff
[
25
];
switch
(
type
)
{
case
TIMESTAMP_NONE
:
store
(
""
,
0
,
default_charset_info
);
// Probably an error
store
(
""
,
0
,
my_charset_latin1
);
// Probably an error
break
;
case
TIMESTAMP_DATE
:
sprintf
(
buff
,
"%04d-%02d-%02d"
,
ltime
->
year
,
ltime
->
month
,
ltime
->
day
);
store
(
buff
,
10
,
default_charset_info
);
store
(
buff
,
10
,
my_charset_latin1
);
break
;
case
TIMESTAMP_FULL
:
sprintf
(
buff
,
"%04d-%02d-%02d %02d:%02d:%02d"
,
ltime
->
year
,
ltime
->
month
,
ltime
->
day
,
ltime
->
hour
,
ltime
->
minute
,
ltime
->
second
);
store
(
buff
,
19
,
default_charset_info
);
store
(
buff
,
19
,
my_charset_latin1
);
break
;
case
TIMESTAMP_TIME
:
{
ulong
length
=
my_sprintf
(
buff
,
(
buff
,
"%02d:%02d:%02d"
,
ltime
->
hour
,
ltime
->
minute
,
ltime
->
second
));
store
(
buff
,(
uint
)
length
,
default_charset_info
);
store
(
buff
,(
uint
)
length
,
my_charset_latin1
);
break
;
}
}
...
...
@@ -326,7 +326,7 @@ bool Field::optimize_range(uint idx)
void
Field_decimal
::
reset
(
void
)
{
Field_decimal
::
store
(
"0"
,
1
,
default_charset_info
);
Field_decimal
::
store
(
"0"
,
1
,
my_charset_latin1
);
}
void
Field_decimal
::
overflow
(
bool
negative
)
...
...
@@ -3785,7 +3785,7 @@ int Field_string::store(double nr)
int
width
=
min
(
field_length
,
DBL_DIG
+
5
);
sprintf
(
buff
,
"%-*.*g"
,
width
,
max
(
width
-
5
,
0
),
nr
);
end
=
strcend
(
buff
,
' '
);
return
Field_string
::
store
(
buff
,(
uint
)
(
end
-
buff
),
default_charset_info
);
return
Field_string
::
store
(
buff
,(
uint
)
(
end
-
buff
),
my_charset_latin1
);
}
...
...
@@ -3984,7 +3984,7 @@ int Field_varstring::store(double nr)
int
width
=
min
(
field_length
,
DBL_DIG
+
5
);
sprintf
(
buff
,
"%-*.*g"
,
width
,
max
(
width
-
5
,
0
),
nr
);
end
=
strcend
(
buff
,
' '
);
return
Field_varstring
::
store
(
buff
,(
uint
)
(
end
-
buff
),
default_charset_info
);
return
Field_varstring
::
store
(
buff
,(
uint
)
(
end
-
buff
),
my_charset_latin1
);
}
...
...
@@ -4550,7 +4550,7 @@ void Field_blob::sql_type(String &res) const
case
3
:
str
=
"medium"
;
break
;
case
4
:
str
=
"long"
;
break
;
}
res
.
set
(
str
,(
uint
)
strlen
(
str
),
default_charset_info
);
res
.
set
(
str
,(
uint
)
strlen
(
str
),
my_charset_latin1
);
res
.
append
(
binary
()
?
"blob"
:
"text"
);
if
(
!
binary
())
{
...
...
@@ -5314,7 +5314,7 @@ create_field::create_field(Field *old_field,Field *orig_field)
orig_field
)
{
char
buff
[
MAX_FIELD_WIDTH
],
*
pos
;
CHARSET_INFO
*
field_charset
=
charset
?
charset
:
default_charset_info
;
CHARSET_INFO
*
field_charset
=
charset
;
String
tmp
(
buff
,
sizeof
(
buff
),
field_charset
);
/* Get the value from record[2] (the default value row) */
...
...
sql/field_conv.cc
View file @
40f828d5
...
...
@@ -263,7 +263,8 @@ static void do_conv_blob(Copy_field *copy)
{
copy
->
from_field
->
val_str
(
&
copy
->
tmp
,
&
copy
->
tmp
);
((
Field_blob
*
)
copy
->
to_field
)
->
store
(
copy
->
tmp
.
ptr
(),
copy
->
tmp
.
length
(),
default_charset_info
);
copy
->
tmp
.
length
(),
copy
->
tmp
.
charset
());
}
/* Save blob in copy->tmp for GROUP BY */
...
...
@@ -275,7 +276,8 @@ static void do_save_blob(Copy_field *copy)
copy
->
from_field
->
val_str
(
&
res
,
&
res
);
copy
->
tmp
.
copy
(
res
);
((
Field_blob
*
)
copy
->
to_field
)
->
store
(
copy
->
tmp
.
ptr
(),
copy
->
tmp
.
length
(),
default_charset_info
);
copy
->
tmp
.
length
(),
copy
->
tmp
.
charset
());
}
...
...
@@ -284,7 +286,7 @@ static void do_field_string(Copy_field *copy)
char
buff
[
MAX_FIELD_WIDTH
];
copy
->
tmp
.
set_quick
(
buff
,
sizeof
(
buff
),
default_charset_info
);
copy
->
from_field
->
val_str
(
&
copy
->
tmp
,
&
copy
->
tmp
);
copy
->
to_field
->
store
(
copy
->
tmp
.
c_ptr_quick
(),
copy
->
tmp
.
length
(),
default_charset_info
);
copy
->
to_field
->
store
(
copy
->
tmp
.
c_ptr_quick
(),
copy
->
tmp
.
length
(),
copy
->
tmp
.
charset
()
);
}
...
...
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