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
9100688c
Commit
9100688c
authored
Dec 06, 2002
by
venu@myvenu.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
item.cc:
Fix for save_in_field to take extra bool argumnet (4.0 merge compatibility)
parent
7e312565
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
34 deletions
+24
-34
include/mysql_com.h
include/mysql_com.h
+1
-1
libmysql/libmysql.c
libmysql/libmysql.c
+0
-1
sql/item.cc
sql/item.cc
+1
-1
sql/item.h
sql/item.h
+1
-1
sql/sql_class.h
sql/sql_class.h
+2
-2
sql/sql_prepare.cc
sql/sql_prepare.cc
+19
-28
No files found.
include/mysql_com.h
View file @
9100688c
...
...
@@ -323,6 +323,6 @@ void my_thread_end(void);
#define NULL_LENGTH ((unsigned long) ~0)
/* For net_store_length */
#define MYSQL_STMT_HEADER 4
#define MYSQL_LONG_DATA_HEADER
8
#define MYSQL_LONG_DATA_HEADER
6
#endif
libmysql/libmysql.c
View file @
9100688c
...
...
@@ -4333,7 +4333,6 @@ mysql_send_long_data(MYSQL_STMT *stmt, uint param_number,
packet
=
extra_data
;
int4store
(
packet
,
stmt
->
stmt_id
);
packet
+=
4
;
int2store
(
packet
,
param_number
);
packet
+=
2
;
int2store
(
packet
,
param
->
buffer_type
);
packet
+=
2
;
/*
Note that we don't get any ok packet from the server in this case
...
...
sql/item.cc
View file @
9100688c
...
...
@@ -351,7 +351,7 @@ void Item_param::set_longdata(const char *str, ulong length)
}
int
Item_param
::
save_in_field
(
Field
*
field
)
int
Item_param
::
save_in_field
(
Field
*
field
,
bool
no_conversions
)
{
if
(
null_value
)
return
(
int
)
set_field_to_null
(
field
);
...
...
sql/item.h
View file @
9100688c
...
...
@@ -252,7 +252,7 @@ class Item_param :public Item
longlong
val_int
();
String
*
val_str
(
String
*
);
void
make_field
(
Send_field
*
field
);
int
save_in_field
(
Field
*
field
);
int
save_in_field
(
Field
*
field
,
bool
no_conversions
);
void
set_null
();
void
set_int
(
longlong
i
);
void
set_double
(
double
i
);
...
...
sql/sql_class.h
View file @
9100688c
...
...
@@ -321,14 +321,14 @@ class MYSQL_ERROR: public Sql_alloc
typedef
struct
st_prep_stmt
{
THD
*
thd
;
Item_param
*
param
;
Item_param
*
*
param
;
Item
*
free_list
;
MEM_ROOT
mem_root
;
ulong
stmt_id
;
uint
param_count
;
uint
last_errno
;
char
last_error
[
MYSQL_ERRMSG_SIZE
];
bool
error_in_prepare
,
long_data_used
,
param_inited
;
bool
error_in_prepare
,
long_data_used
;
}
PREP_STMT
;
...
...
sql/sql_prepare.cc
View file @
9100688c
...
...
@@ -310,11 +310,8 @@ static bool setup_params_data(PREP_STMT *stmt)
*/
while
((
param
=
(
Item_param
*
)
param_iterator
++
))
{
if
(
!
param
->
long_data_supplied
)
{
setup_param_functions
(
param
,
*
read_pos
);
read_pos
+=
2
;
}
setup_param_functions
(
param
,
*
read_pos
);
read_pos
+=
2
;
}
param_iterator
.
rewind
();
}
...
...
@@ -615,7 +612,7 @@ static bool parse_prepare_query(PREP_STMT *stmt,
mysql_log
.
write
(
thd
,
COM_PREPARE
,
"%s"
,
packet
);
mysql_init_query
(
thd
);
thd
->
prepare_command
=
true
;
thd
->
lex
.
param_count
=
0
;
thd
->
lex
.
param_count
=
0
;
LEX
*
lex
=
lex_start
(
thd
,
(
uchar
*
)
packet
,
length
);
lex
->
safe_to_cache_query
=
0
;
...
...
@@ -630,18 +627,13 @@ static bool parse_prepare_query(PREP_STMT *stmt,
*/
static
bool
init_param_items
(
THD
*
thd
,
PREP_STMT
*
stmt
)
{
#if TO_BE_TESTED
Item_param
**
to
;
if
(
!
(
to
=
(
Item_param
*
)
my_malloc
(
sizeof
(
Item_param
*
)
*
stmt
->
param_count
,
MYF
(
MY_WME
))))
if
(
!
(
stmt
->
param
=
to
=
(
Item_param
**
)
my_malloc
(
sizeof
(
Item_param
*
)
*
(
stmt
->
param_count
+
1
),
MYF
(
MY_WME
))))
return
1
;
List
<
Item
>
&
params
=
thd
->
lex
.
param_list
;
List_iterator
<
Item
>
param_iterator
(
params
);
while
((
to
++
=
(
Item_param
*
)
param_iterator
++
))
{
DBUG_PRINT
(
"info"
,(
"param: %lx"
,
to
));
}
#endif
List_iterator
<
Item
>
param_iterator
(
thd
->
lex
.
param_list
);
while
((
*
(
to
++
)
=
(
Item_param
*
)
param_iterator
++
));
return
0
;
}
...
...
@@ -678,10 +670,10 @@ bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length)
if
(
!
(
specialflag
&
SPECIAL_NO_PRIOR
))
my_pthread_setprio
(
pthread_self
(),
WAIT_PRIOR
);
#if 0
if
(
init_param_items
(
thd
,
&
stmt
))
goto
err
;
#endif
stmt
.
mem_root
=
thd
->
mem_root
;
tree_insert
(
&
thd
->
prepared_statements
,
(
void
*
)
&
stmt
,
0
,
(
void
*
)
0
);
thd
->
mem_root
=
thd_root
;
// restore main mem_root
...
...
@@ -769,8 +761,8 @@ void mysql_stmt_reset(THD *thd, char *packet)
DBUG_VOID_RETURN
;
}
stmt
->
error_in_prepare
=
0
;
Item_param
*
item
=
stmt
->
param
,
*
end
=
item
+
stmt
->
param_count
;
stmt
->
error_in_prepare
=
0
;
Item_param
*
item
=
*
stmt
->
param
,
*
end
=
item
+
stmt
->
param_count
;
/* Free long data if used */
if
(
stmt
->
long_data_used
)
...
...
@@ -795,12 +787,10 @@ void mysql_stmt_free(THD *thd, char *packet)
if
(
!
(
stmt
=
find_prepared_statement
(
thd
,
stmt_id
,
"close"
)))
{
send_error
(
thd
);
send_error
(
thd
);
// Not seen by the client
DBUG_VOID_RETURN
;
}
stmt
->
param
=
0
;
my_free
((
char
*
)
stmt
->
param
,
MYF
(
MY_ALLOW_ZERO_PTR
));
/* Will call free_prep_stmt() */
tree_delete
(
&
thd
->
prepared_statements
,
(
void
*
)
&
stmt
,
(
void
*
)
0
);
thd
->
last_prepared_stmt
=
0
;
DBUG_VOID_RETURN
;
...
...
@@ -840,8 +830,7 @@ void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length)
ulong
stmt_id
=
uint4korr
(
pos
);
uint
param_number
=
uint2korr
(
pos
+
4
);
uint
param_type
=
uint2korr
(
pos
+
6
);
pos
+=
MYSQL_LONG_DATA_HEADER
;
// Point to data
pos
+=
MYSQL_LONG_DATA_HEADER
;
// Point to data
if
(
!
(
stmt
=
find_prepared_statement
(
thd
,
stmt_id
,
"get_longdata"
)))
{
...
...
@@ -855,12 +844,14 @@ void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length)
if
(
param_number
>=
stmt
->
param_count
)
{
stmt
->
error_in_prepare
=
1
;
stmt
->
last_errno
=
ER_WRONG_ARGUMENTS
;
/* Error will be sent in execute call */
stmt
->
error_in_prepare
=
1
;
stmt
->
last_errno
=
ER_WRONG_ARGUMENTS
;
sprintf
(
stmt
->
last_error
,
ER
(
ER_WRONG_ARGUMENTS
),
"get_longdata"
);
DBUG_VOID_RETURN
;
}
stmt
->
param
[
param_number
].
set_longdata
(
pos
,
packet_length
-
9
);
Item_param
*
param
=
*
(
stmt
->
param
+
param_number
);
param
->
set_longdata
(
pos
,
packet_length
-
MYSQL_LONG_DATA_HEADER
-
1
);
stmt
->
long_data_used
=
1
;
DBUG_VOID_RETURN
;
}
...
...
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