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
56a9b118
Commit
56a9b118
authored
Mar 15, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Plain Diff
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-in-4.1
parents
bffd0153
54167da4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
17 deletions
+25
-17
sql/gstream.cc
sql/gstream.cc
+11
-6
sql/gstream.h
sql/gstream.h
+5
-4
sql/item_geofunc.cc
sql/item_geofunc.cc
+6
-4
sql/item_strfunc.cc
sql/item_strfunc.cc
+2
-2
sql/spatial.h
sql/spatial.h
+1
-1
No files found.
sql/gstream.cc
View file @
56a9b118
...
...
@@ -24,7 +24,7 @@
enum
Gis_read_stream
::
enum_tok_types
Gis_read_stream
::
get_next_toc_type
()
{
skip_space
();
if
(
!*
m_cur
)
if
(
m_cur
>=
m_limit
)
return
eostream
;
if
(
my_isvar_start
(
&
my_charset_bin
,
*
m_cur
))
return
word
;
...
...
@@ -53,7 +53,7 @@ bool Gis_read_stream::get_next_word(LEX_STRING *res)
my_isvar() is a macro that would cause side effects
*/
m_cur
++
;
while
(
my_isvar
(
&
my_charset_bin
,
*
m_cur
))
while
(
(
m_cur
<
m_limit
)
&&
my_isvar
(
&
my_charset_bin
,
*
m_cur
))
m_cur
++
;
res
->
length
=
(
uint32
)
(
m_cur
-
res
->
str
);
...
...
@@ -71,16 +71,21 @@ bool Gis_read_stream::get_next_word(LEX_STRING *res)
bool
Gis_read_stream
::
get_next_number
(
double
*
d
)
{
char
*
endptr
;
int
err
;
skip_space
();
/* The following will also test for end \0 */
if
((
*
m_cur
<
'0'
||
*
m_cur
>
'9'
)
&&
*
m_cur
!=
'-'
&&
*
m_cur
!=
'+'
)
if
((
m_cur
>=
m_limit
)
||
(
*
m_cur
<
'0'
||
*
m_cur
>
'9'
)
&&
*
m_cur
!=
'-'
&&
*
m_cur
!=
'+'
)
{
set_error_msg
(
"Numeric constant expected"
);
return
1
;
}
*
d
=
my_strtod
(
m_cur
,
&
endptr
);
*
d
=
my_strntod
(
m_charset
,
(
char
*
)
m_cur
,
m_limit
-
m_cur
,
&
endptr
,
&
err
);
if
(
err
)
return
1
;
if
(
endptr
)
m_cur
=
endptr
;
return
0
;
...
...
@@ -90,7 +95,7 @@ bool Gis_read_stream::get_next_number(double *d)
bool
Gis_read_stream
::
check_next_symbol
(
char
symbol
)
{
skip_space
();
if
(
*
m_cur
!=
symbol
)
if
(
(
m_cur
>=
m_limit
)
||
(
*
m_cur
!=
symbol
)
)
{
char
buff
[
32
];
strmov
(
buff
,
"'?' expected"
);
...
...
sql/gstream.h
View file @
56a9b118
...
...
@@ -29,8 +29,8 @@ class Gis_read_stream
comma
};
Gis_read_stream
(
const
char
*
buffer
,
int
size
)
:
m_cur
(
buffer
),
m_limit
(
buffer
+
size
),
m_err_msg
(
NULL
)
Gis_read_stream
(
CHARSET_INFO
*
charset
,
const
char
*
buffer
,
int
size
)
:
m_cur
(
buffer
),
m_limit
(
buffer
+
size
),
m_err_msg
(
NULL
)
,
m_charset
(
charset
)
{}
Gis_read_stream
()
:
m_cur
(
NullS
),
m_limit
(
NullS
),
m_err_msg
(
NullS
)
{}
...
...
@@ -46,14 +46,14 @@ class Gis_read_stream
inline
void
skip_space
()
{
while
(
my_isspace
(
&
my_charset_latin1
,
*
m_cur
))
while
(
(
m_cur
<
m_limit
)
&&
my_isspace
(
&
my_charset_latin1
,
*
m_cur
))
m_cur
++
;
}
/* Skip next character, if match. Return 1 if no match */
inline
bool
skip_char
(
char
skip
)
{
skip_space
();
if
(
*
m_cur
!=
skip
)
if
(
(
m_cur
>=
m_limit
)
||
*
m_cur
!=
skip
)
return
1
;
/* Didn't find char */
m_cur
++
;
return
0
;
...
...
@@ -72,4 +72,5 @@ class Gis_read_stream
const
char
*
m_cur
;
const
char
*
m_limit
;
char
*
m_err_msg
;
CHARSET_INFO
*
m_charset
;
};
sql/item_geofunc.cc
View file @
56a9b118
...
...
@@ -31,10 +31,13 @@
String
*
Item_func_geometry_from_text
::
val_str
(
String
*
str
)
{
Geometry_buffer
buffer
;
Geometry
*
geom
;
String
arg_val
;
String
*
wkt
=
args
[
0
]
->
val_str
(
&
arg_val
);
Gis_read_stream
trs
(
wkt
->
c_ptr
(),
wkt
->
length
());
if
((
null_value
=
args
[
0
]
->
null_value
))
return
0
;
Gis_read_stream
trs
(
wkt
->
charset
(),
wkt
->
ptr
(),
wkt
->
length
());
uint32
srid
=
0
;
if
((
arg_count
==
2
)
&&
!
args
[
1
]
->
null_value
)
...
...
@@ -44,8 +47,7 @@ String *Item_func_geometry_from_text::val_str(String *str)
return
0
;
str
->
length
(
0
);
str
->
q_append
(
srid
);
if
((
null_value
=
(
args
[
0
]
->
null_value
||
!
(
geom
=
Geometry
::
create_from_wkt
(
&
buffer
,
&
trs
,
str
,
0
)))))
if
((
null_value
=
!
Geometry
::
create_from_wkt
(
&
buffer
,
&
trs
,
str
,
0
)))
return
0
;
return
str
;
}
...
...
sql/item_strfunc.cc
View file @
56a9b118
...
...
@@ -2241,7 +2241,7 @@ String *Item_func_hex::val_str(String *str)
return
&
tmp_value
;
}
in
t
inline
hexchar_to_int
(
char
c
)
in
line
int
hexchar_to_int
(
char
c
)
{
if
(
c
<=
'9'
&&
c
>=
'0'
)
return
c
-
'0'
;
...
...
@@ -2721,7 +2721,7 @@ String *Item_func_uuid::val_str(String *str)
{
ulong
tmp
=
sql_rnd_with_mutex
();
uchar
mac
[
6
];
int
i
;
unsigned
int
i
;
if
(
my_gethwaddr
(
mac
))
{
/*
...
...
sql/spatial.h
View file @
56a9b118
...
...
@@ -157,7 +157,7 @@ struct Geometry_buffer;
class
Geometry
{
public:
static
void
*
operator
new
(
unsigned
size_t
,
void
*
buffer
)
static
void
*
operator
new
(
size_t
size
,
void
*
buffer
)
{
return
buffer
;
}
...
...
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