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
b30c28d8
Commit
b30c28d8
authored
Apr 03, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
for Item_param we have to have value set instead of fave item fixed (BUG#3353)
fixed outer joins test of different joins included
parent
c31f3cf1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
18 deletions
+35
-18
sql/item.cc
sql/item.cc
+4
-4
sql/sql_base.cc
sql/sql_base.cc
+3
-0
tests/client_test.c
tests/client_test.c
+28
-14
No files found.
sql/item.cc
View file @
b30c28d8
...
@@ -713,7 +713,7 @@ bool Item_param::get_time(TIME *res)
...
@@ -713,7 +713,7 @@ bool Item_param::get_time(TIME *res)
double
Item_param
::
val
()
double
Item_param
::
val
()
{
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
value_is_set
==
1
);
int
err
;
int
err
;
switch
(
item_result_type
)
{
switch
(
item_result_type
)
{
case
STRING_RESULT
:
case
STRING_RESULT
:
...
@@ -729,7 +729,7 @@ double Item_param::val()
...
@@ -729,7 +729,7 @@ double Item_param::val()
longlong
Item_param
::
val_int
()
longlong
Item_param
::
val_int
()
{
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
value_is_set
==
1
);
int
err
;
int
err
;
switch
(
item_result_type
)
{
switch
(
item_result_type
)
{
case
STRING_RESULT
:
case
STRING_RESULT
:
...
@@ -746,7 +746,7 @@ longlong Item_param::val_int()
...
@@ -746,7 +746,7 @@ longlong Item_param::val_int()
String
*
Item_param
::
val_str
(
String
*
str
)
String
*
Item_param
::
val_str
(
String
*
str
)
{
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
value_is_set
==
1
);
switch
(
item_result_type
)
{
switch
(
item_result_type
)
{
case
INT_RESULT
:
case
INT_RESULT
:
str
->
set
(
int_value
,
&
my_charset_bin
);
str
->
set
(
int_value
,
&
my_charset_bin
);
...
@@ -766,7 +766,7 @@ String *Item_param::val_str(String* str)
...
@@ -766,7 +766,7 @@ String *Item_param::val_str(String* str)
String
*
Item_param
::
query_val_str
(
String
*
str
)
String
*
Item_param
::
query_val_str
(
String
*
str
)
{
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
value_is_set
==
1
);
switch
(
item_result_type
)
{
switch
(
item_result_type
)
{
case
INT_RESULT
:
case
INT_RESULT
:
case
REAL_RESULT
:
case
REAL_RESULT
:
...
...
sql/sql_base.cc
View file @
b30c28d8
...
@@ -2469,6 +2469,9 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
...
@@ -2469,6 +2469,9 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
}
}
thd
->
lex
->
current_select
->
cond_count
+=
cond_and
->
list
.
elements
;
thd
->
lex
->
current_select
->
cond_count
+=
cond_and
->
list
.
elements
;
// to prevent natural join processing during PS re-execution
table
->
natural_join
=
0
;
if
(
!
table
->
outer_join
)
// Not left join
if
(
!
table
->
outer_join
)
// Not left join
{
{
*
conds
=
and_conds
(
*
conds
,
cond_and
);
*
conds
=
and_conds
(
*
conds
,
cond_and
);
...
...
tests/client_test.c
View file @
b30c28d8
...
@@ -8495,13 +8495,21 @@ static void test_bug3117()
...
@@ -8495,13 +8495,21 @@ static void test_bug3117()
}
}
static
void
test_o
n
()
static
void
jest_joi
n
()
{
{
MYSQL_STMT
*
stmt
;
MYSQL_STMT
*
stmt
;
int
rc
,
i
;
int
rc
,
i
,
j
;
const
char
*
query
=
"SELECT * FROM t2 join t1 on (t1.a=t2.a)"
;
const
char
*
query
[]
=
{
"SELECT * FROM t2 join t1 on (t1.a=t2.a)"
,
"SELECT * FROM t2 natural join t1"
,
myheader
(
"test_on"
);
"SELECT * FROM t2 join t1 using(a)"
,
"SELECT * FROM t2 left join t1 on(t1.a=t2.a)"
,
"SELECT * FROM t2 natural left join t1"
,
"SELECT * FROM t2 left join t1 using(a)"
,
"SELECT * FROM t2 right join t1 on(t1.a=t2.a)"
,
"SELECT * FROM t2 natural right join t1"
,
"SELECT * FROM t2 right join t1 using(a)"
};
myheader
(
"jest_join"
);
rc
=
mysql_query
(
mysql
,
"DROP TABLE IF EXISTS t1,t2"
);
rc
=
mysql_query
(
mysql
,
"DROP TABLE IF EXISTS t1,t2"
);
myquery
(
rc
);
myquery
(
rc
);
...
@@ -8513,18 +8521,24 @@ static void test_on()
...
@@ -8513,18 +8521,24 @@ static void test_on()
"insert into t1 values (1,1), (2, 2), (3,3), (4,4), (5,5);"
);
"insert into t1 values (1,1), (2, 2), (3,3), (4,4), (5,5);"
);
myquery
(
rc
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"
create table t2 select * from t1
;"
);
rc
=
mysql_query
(
mysql
,
"
CREATE TABLE t2 (a int , c int)
;"
);
myquery
(
rc
);
myquery
(
rc
);
stmt
=
mysql_prepare
(
mysql
,
query
,
strlen
(
query
));
rc
=
mysql_query
(
mysql
,
mystmt_init
(
stmt
);
"insert into t2 values (1,1), (2, 2), (3,3), (4,4), (5,5);"
);
for
(
i
=
0
;
i
<
3
;
i
++
)
for
(
j
=
0
;
j
<
9
;
j
++
)
{
{
rc
=
mysql_execute
(
stmt
);
stmt
=
mysql_prepare
(
mysql
,
query
[
j
],
strlen
(
query
[
j
]));
mystmt
(
stmt
,
rc
);
mystmt_init
(
stmt
);
assert
(
5
==
my_process_stmt_result
(
stmt
));
for
(
i
=
0
;
i
<
3
;
i
++
)
{
rc
=
mysql_execute
(
stmt
);
mystmt
(
stmt
,
rc
);
assert
(
5
==
my_process_stmt_result
(
stmt
));
}
mysql_stmt_close
(
stmt
);
}
}
mysql_stmt_close
(
stmt
);
rc
=
mysql_query
(
mysql
,
"DROP TABLE t1,t2"
);
rc
=
mysql_query
(
mysql
,
"DROP TABLE t1,t2"
);
myquery
(
rc
);
myquery
(
rc
);
...
@@ -8836,7 +8850,7 @@ int main(int argc, char **argv)
...
@@ -8836,7 +8850,7 @@ int main(int argc, char **argv)
Item_field -> Item_ref */
Item_field -> Item_ref */
test_union
();
/* test union with prepared statements */
test_union
();
/* test union with prepared statements */
test_bug3117
();
/* BUG#3117: LAST_INSERT_ID() */
test_bug3117
();
/* BUG#3117: LAST_INSERT_ID() */
test_on
();
/* ... join ... on()
, BUG#2794 */
jest_join
();
/* different kinds of join
, BUG#2794 */
test_selecttmp
();
/* temporary table used in select execution */
test_selecttmp
();
/* temporary table used in select execution */
...
...
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