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
894e8fca
Commit
894e8fca
authored
May 12, 2004
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Portability fixes
parent
6c4b8d34
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
21 deletions
+38
-21
scripts/mysql_install_db.sh
scripts/mysql_install_db.sh
+7
-3
sql/item_func.cc
sql/item_func.cc
+4
-1
sql/repl_failsafe.cc
sql/repl_failsafe.cc
+3
-1
sql/sql_analyse.cc
sql/sql_analyse.cc
+9
-3
sql/sql_yacc.yy
sql/sql_yacc.yy
+12
-10
strings/my_strtoll10.c
strings/my_strtoll10.c
+3
-3
No files found.
scripts/mysql_install_db.sh
View file @
894e8fca
...
@@ -10,6 +10,8 @@
...
@@ -10,6 +10,8 @@
in_rpm
=
0
in_rpm
=
0
windows
=
0
windows
=
0
defaults
=
""
defaults
=
""
tmp_file
=
/tmp/mysql_install_db.
$$
case
"
$1
"
in
case
"
$1
"
in
--no-defaults
|
--defaults-file
=
*
|
--defaults-extra-file
=
*
)
--no-defaults
|
--defaults-file
=
*
|
--defaults-extra-file
=
*
)
defaults
=
"
$1
"
;
shift
defaults
=
"
$1
"
;
shift
...
@@ -212,9 +214,11 @@ then
...
@@ -212,9 +214,11 @@ then
then
then
echo
"Fill help tables"
echo
"Fill help tables"
fi
fi
if
!
(
echo
"use mysql;
echo
"use mysql;"
>
$tmp_file
"
cat
$tmp_file
$fill_help_tables
|
eval
"
$mysqld_install_cmd_line
"
cat
$fill_help_tables
)
|
eval
"
$mysqld_install_cmd_line
"
res
=
$?
rm
$tmp_file
if
test
$res
!=
0
then
then
echo
""
echo
""
echo
"WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!"
echo
"WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!"
...
...
sql/item_func.cc
View file @
894e8fca
...
@@ -2376,7 +2376,10 @@ longlong user_var_entry::val_int(my_bool *null_value)
...
@@ -2376,7 +2376,10 @@ longlong user_var_entry::val_int(my_bool *null_value)
case
INT_RESULT
:
case
INT_RESULT
:
return
*
(
longlong
*
)
value
;
return
*
(
longlong
*
)
value
;
case
STRING_RESULT
:
case
STRING_RESULT
:
return
strtoull
(
value
,
NULL
,
10
);
// String is null terminated
{
int
error
;
return
my_strtoll10
(
value
,
(
char
**
)
0
,
&
error
);
// String is null terminated
}
case
ROW_RESULT
:
case
ROW_RESULT
:
DBUG_ASSERT
(
1
);
// Impossible
DBUG_ASSERT
(
1
);
// Impossible
break
;
break
;
...
...
sql/repl_failsafe.cc
View file @
894e8fca
...
@@ -915,12 +915,14 @@ int load_master_data(THD* thd)
...
@@ -915,12 +915,14 @@ int load_master_data(THD* thd)
setting active_mi, because init_master_info() sets active_mi with
setting active_mi, because init_master_info() sets active_mi with
defaults.
defaults.
*/
*/
int
error
;
if
(
init_master_info
(
active_mi
,
master_info_file
,
relay_log_info_file
,
if
(
init_master_info
(
active_mi
,
master_info_file
,
relay_log_info_file
,
0
))
0
))
send_error
(
thd
,
ER_MASTER_INFO
);
send_error
(
thd
,
ER_MASTER_INFO
);
strmake
(
active_mi
->
master_log_name
,
row
[
0
],
strmake
(
active_mi
->
master_log_name
,
row
[
0
],
sizeof
(
active_mi
->
master_log_name
));
sizeof
(
active_mi
->
master_log_name
));
active_mi
->
master_log_pos
=
strtoull
(
row
[
1
],
(
char
**
)
0
,
10
);
active_mi
->
master_log_pos
=
my_strtoll10
(
row
[
1
],
(
char
**
)
0
,
&
error
);
/* at least in recent versions, the condition below should be false */
/* at least in recent versions, the condition below should be false */
if
(
active_mi
->
master_log_pos
<
BIN_LOG_HEADER_SIZE
)
if
(
active_mi
->
master_log_pos
<
BIN_LOG_HEADER_SIZE
)
active_mi
->
master_log_pos
=
BIN_LOG_HEADER_SIZE
;
active_mi
->
master_log_pos
=
BIN_LOG_HEADER_SIZE
;
...
...
sql/sql_analyse.cc
View file @
894e8fca
...
@@ -187,7 +187,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
...
@@ -187,7 +187,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
}
}
if
(
str
==
end
&&
info
->
integers
)
if
(
str
==
end
&&
info
->
integers
)
{
{
info
->
ullval
=
(
ulonglong
)
strtoull
(
begin
,
NULL
,
10
);
char
*
endpos
=
(
char
*
)
end
;
int
error
;
info
->
ullval
=
(
ulonglong
)
my_strtoll10
(
begin
,
&
endpos
,
&
error
);
if
(
info
->
integers
==
1
)
if
(
info
->
integers
==
1
)
return
0
;
// a single number can't be zerofill
return
0
;
// a single number can't be zerofill
info
->
maybe_zerofill
=
1
;
info
->
maybe_zerofill
=
1
;
...
@@ -199,7 +201,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
...
@@ -199,7 +201,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
return
0
;
return
0
;
if
((
str
+
1
)
==
end
)
// number was something like '123[.eE]'
if
((
str
+
1
)
==
end
)
// number was something like '123[.eE]'
{
{
info
->
ullval
=
(
ulonglong
)
strtoull
(
begin
,
NULL
,
10
);
char
*
endpos
=
(
char
*
)
str
;
int
error
;
info
->
ullval
=
(
ulonglong
)
my_strtoll10
(
begin
,
&
endpos
,
&
error
);
return
1
;
return
1
;
}
}
if
(
*
str
==
'e'
||
*
str
==
'E'
)
// number may be something like '1e+50'
if
(
*
str
==
'e'
||
*
str
==
'E'
)
// number may be something like '1e+50'
...
@@ -218,7 +222,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
...
@@ -218,7 +222,9 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
for
(
str
++
;
*
(
end
-
1
)
==
'0'
;
end
--
);
// jump over zeros at the end
for
(
str
++
;
*
(
end
-
1
)
==
'0'
;
end
--
);
// jump over zeros at the end
if
(
str
==
end
)
// number was something like '123.000'
if
(
str
==
end
)
// number was something like '123.000'
{
{
info
->
ullval
=
(
ulonglong
)
strtoull
(
begin
,
NULL
,
10
);
char
*
endpos
=
(
char
*
)
str
;
int
error
;
info
->
ullval
=
(
ulonglong
)
my_strtoll10
(
begin
,
&
endpos
,
&
error
);
return
1
;
return
1
;
}
}
for
(;
str
!=
end
&&
my_isdigit
(
system_charset_info
,
*
str
);
str
++
)
for
(;
str
!=
end
&&
my_isdigit
(
system_charset_info
,
*
str
);
str
++
)
...
...
sql/sql_yacc.yy
View file @
894e8fca
...
@@ -3636,18 +3636,20 @@ delete_limit_clause:
...
@@ -3636,18 +3636,20 @@ delete_limit_clause:
};
};
ULONG_NUM:
ULONG_NUM:
NUM { $$= strtoul($1.str,NULL,10); }
NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
| LONG_NUM { $$= (ulong) strtoll($1.str,NULL,10); }
| LONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
| ULONGLONG_NUM { $$= (ulong) strtoull($1.str,NULL,10); }
| ULONGLONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
| REAL_NUM { $$= strtoul($1.str,NULL,10); }
| REAL_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
| FLOAT_NUM { $$= strtoul($1.str,NULL,10); };
| FLOAT_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
;
ulonglong_num:
ulonglong_num:
NUM { $$= (ulonglong) strtoul($1.str,NULL,10); }
NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
| ULONGLONG_NUM { $$= strtoull($1.str,NULL,10); }
| ULONGLONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
| LONG_NUM { $$= (ulonglong) strtoll($1.str,NULL,10); }
| LONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
| REAL_NUM { $$= strtoull($1.str,NULL,10); }
| REAL_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
| FLOAT_NUM { $$= strtoull($1.str,NULL,10); };
| FLOAT_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
;
procedure_clause:
procedure_clause:
/* empty */
/* empty */
...
...
strings/my_strtoll10.c
View file @
894e8fca
...
@@ -196,15 +196,15 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error)
...
@@ -196,15 +196,15 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error)
goto
overflow
;
goto
overflow
;
/* Check that we didn't get an overflow with the last digit */
/* Check that we didn't get an overflow with the last digit */
if
(
i
>
cutoff
||
i
==
cutoff
&&
(
j
>
cutoff2
||
j
==
cutoff2
&&
if
(
i
>
cutoff
||
(
i
==
cutoff
&&
((
j
>
cutoff2
||
j
==
cutoff2
)
&&
k
>
cutoff3
))
k
>
cutoff3
)
))
goto
overflow
;
goto
overflow
;
li
=
i
*
LFACTOR2
+
(
ulonglong
)
j
*
100
+
k
;
li
=
i
*
LFACTOR2
+
(
ulonglong
)
j
*
100
+
k
;
return
(
longlong
)
li
;
return
(
longlong
)
li
;
overflow:
/* *endptr is set here */
overflow:
/* *endptr is set here */
*
error
=
MY_ERRNO_ERANGE
;
*
error
=
MY_ERRNO_ERANGE
;
return
negative
?
LONGLONG_MIN
:
ULONGLONG_MAX
;
return
negative
?
LONGLONG_MIN
:
(
longlong
)
ULONGLONG_MAX
;
end_i:
end_i:
*
endptr
=
(
char
*
)
s
;
*
endptr
=
(
char
*
)
s
;
...
...
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