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
3879fa38
Commit
3879fa38
authored
Jun 25, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge paul@bk-internal.mysql.com:/home/bk/mysql-4.1
into ice.snake.net:/Volumes/ice2/MySQL/bk/mysql-4.1
parents
60c1f31e
d94b3470
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
10 deletions
+40
-10
mysql-test/r/ps.result
mysql-test/r/ps.result
+13
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+13
-0
sql/item.cc
sql/item.cc
+4
-0
sql/item.h
sql/item.h
+10
-10
No files found.
mysql-test/r/ps.result
View file @
3879fa38
...
@@ -179,3 +179,16 @@ id select_type table type possible_keys key key_len ref rows Extra
...
@@ -179,3 +179,16 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
2 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
deallocate prepare stmt1;
deallocate prepare stmt1;
drop tables t1,t2;
drop tables t1,t2;
set @arg00=1;
prepare stmt1 from ' create table t1 (m int) as select 1 as m ' ;
execute stmt1 ;
select m from t1;
m
1
drop table t1;
prepare stmt1 from ' create table t1 (m int) as select ? as m ' ;
execute stmt1 using @arg00;
select m from t1;
m
1
drop table t1;
mysql-test/t/ps.test
View file @
3879fa38
...
@@ -166,3 +166,16 @@ execute stmt1 ;
...
@@ -166,3 +166,16 @@ execute stmt1 ;
explain
SELECT
(
SELECT
SUM
(
c1
+
c12
+
0.0
)
FROM
t2
where
(
t1
.
c2
-
0
e
-
3
)
=
t2
.
c2
GROUP
BY
t1
.
c15
LIMIT
1
)
as
scalar_s
,
exists
(
select
1.0e+0
from
t2
where
t2
.
c3
*
9.0000000000
=
t1
.
c4
)
as
exists_s
,
c5
*
4
in
(
select
c6
+
0.3e+1
from
t2
)
as
in_s
,
(
c7
-
4
,
c8
-
4
)
in
(
select
c9
+
4.0
,
c10
+
40
e
-
1
from
t2
)
as
in_row_s
FROM
t1
,
(
select
c25
x
,
c32
y
from
t2
)
tt
WHERE
x
*
1
=
c25
;
explain
SELECT
(
SELECT
SUM
(
c1
+
c12
+
0.0
)
FROM
t2
where
(
t1
.
c2
-
0
e
-
3
)
=
t2
.
c2
GROUP
BY
t1
.
c15
LIMIT
1
)
as
scalar_s
,
exists
(
select
1.0e+0
from
t2
where
t2
.
c3
*
9.0000000000
=
t1
.
c4
)
as
exists_s
,
c5
*
4
in
(
select
c6
+
0.3e+1
from
t2
)
as
in_s
,
(
c7
-
4
,
c8
-
4
)
in
(
select
c9
+
4.0
,
c10
+
40
e
-
1
from
t2
)
as
in_row_s
FROM
t1
,
(
select
c25
x
,
c32
y
from
t2
)
tt
WHERE
x
*
1
=
c25
;
deallocate
prepare
stmt1
;
deallocate
prepare
stmt1
;
drop
tables
t1
,
t2
;
drop
tables
t1
,
t2
;
#
# parameters from variables (for field creation)
#
set
@
arg00
=
1
;
prepare
stmt1
from
' create table t1 (m int) as select 1 as m '
;
execute
stmt1
;
select
m
from
t1
;
drop
table
t1
;
prepare
stmt1
from
' create table t1 (m int) as select ? as m '
;
execute
stmt1
using
@
arg00
;
select
m
from
t1
;
drop
table
t1
;
sql/item.cc
View file @
3879fa38
...
@@ -759,9 +759,13 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry)
...
@@ -759,9 +759,13 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry)
switch
(
entry
->
type
)
{
switch
(
entry
->
type
)
{
case
REAL_RESULT
:
case
REAL_RESULT
:
set_double
(
*
(
double
*
)
entry
->
value
);
set_double
(
*
(
double
*
)
entry
->
value
);
item_type
=
Item
::
REAL_ITEM
;
item_result_type
=
REAL_RESULT
;
break
;
break
;
case
INT_RESULT
:
case
INT_RESULT
:
set_int
(
*
(
longlong
*
)
entry
->
value
,
21
);
set_int
(
*
(
longlong
*
)
entry
->
value
,
21
);
item_type
=
Item
::
INT_ITEM
;
item_result_type
=
INT_RESULT
;
break
;
break
;
case
STRING_RESULT
:
case
STRING_RESULT
:
{
{
...
...
sql/item.h
View file @
3879fa38
...
@@ -422,7 +422,7 @@ class Item_null :public Item
...
@@ -422,7 +422,7 @@ class Item_null :public Item
class
Item_param
:
public
Item
class
Item_param
:
public
Item
{
{
public:
public:
enum
enum_item_param_state
enum
enum_item_param_state
{
{
NO_VALUE
,
NULL_VALUE
,
INT_VALUE
,
REAL_VALUE
,
NO_VALUE
,
NULL_VALUE
,
INT_VALUE
,
REAL_VALUE
,
...
@@ -442,8 +442,8 @@ class Item_param :public Item
...
@@ -442,8 +442,8 @@ class Item_param :public Item
String
str_value_ptr
;
String
str_value_ptr
;
union
union
{
{
longlong
integer
;
longlong
integer
;
double
real
;
double
real
;
/*
/*
Character sets conversion info for string values.
Character sets conversion info for string values.
Character sets of client and connection defined at bind time are used
Character sets of client and connection defined at bind time are used
...
@@ -456,7 +456,7 @@ class Item_param :public Item
...
@@ -456,7 +456,7 @@ class Item_param :public Item
/*
/*
This points at character set of connection if conversion
This points at character set of connection if conversion
to it is required (i. e. if placeholder typecode is not BLOB).
to it is required (i. e. if placeholder typecode is not BLOB).
Otherwise it's equal to character_set_client (to simplify
Otherwise it's equal to character_set_client (to simplify
check in convert_str_value()).
check in convert_str_value()).
*/
*/
CHARSET_INFO
*
final_character_set_of_str_value
;
CHARSET_INFO
*
final_character_set_of_str_value
;
...
@@ -477,10 +477,10 @@ class Item_param :public Item
...
@@ -477,10 +477,10 @@ class Item_param :public Item
supply for this placeholder in mysql_stmt_execute.
supply for this placeholder in mysql_stmt_execute.
*/
*/
enum
enum_field_types
param_type
;
enum
enum_field_types
param_type
;
/*
/*
Offset of placeholder inside statement text. Used to create
Offset of placeholder inside statement text. Used to create
no-placeholders version of this statement for the binary log.
no-placeholders version of this statement for the binary log.
*/
*/
uint
pos_in_query
;
uint
pos_in_query
;
Item_param
(
uint
pos_in_query_arg
);
Item_param
(
uint
pos_in_query_arg
);
...
@@ -515,11 +515,11 @@ class Item_param :public Item
...
@@ -515,11 +515,11 @@ class Item_param :public Item
const
String
*
query_val_str
(
String
*
str
)
const
;
const
String
*
query_val_str
(
String
*
str
)
const
;
bool
convert_str_value
(
THD
*
thd
);
bool
convert_str_value
(
THD
*
thd
);
Item
*
new_item
()
{
return
new
Item_param
(
pos_in_query
);
}
Item
*
new_item
()
{
return
new
Item_param
(
pos_in_query
);
}
/*
/*
If value for parameter was not set we treat it as non-const
If value for parameter was not set we treat it as non-const
so noone will use parameters value in fix_fields still
so noone will use parameters value in fix_fields still
parameter is constant during execution.
parameter is constant during execution.
*/
*/
virtual
table_map
used_tables
()
const
virtual
table_map
used_tables
()
const
...
...
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