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
303dafc5
Commit
303dafc5
authored
Jun 15, 2005
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix of BUG#11111 fix
parent
50def61b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
16 deletions
+27
-16
sql/item.h
sql/item.h
+3
-6
sql/sql_select.cc
sql/sql_select.cc
+1
-1
tests/mysql_client_test.c
tests/mysql_client_test.c
+23
-9
No files found.
sql/item.h
View file @
303dafc5
...
...
@@ -1352,12 +1352,9 @@ class Item_ref :public Item_ident
{
(
*
ref
)
->
save_in_field
(
result_field
,
no_conversions
);
}
Item
*
real_item
()
{
Item
*
item
=
this
;
do
item
=
*
((
Item_ref
*
)
item
)
->
ref
;
while
(
item
->
type
()
==
Item
::
REF_ITEM
);
return
item
;
Item
*
real_item
()
{
return
(
*
ref
)
->
real_item
();
}
bool
walk
(
Item_processor
processor
,
byte
*
arg
)
{
return
(
*
ref
)
->
walk
(
processor
,
arg
);
}
...
...
sql/sql_select.cc
View file @
303dafc5
...
...
@@ -7958,7 +7958,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
convert_blob_length
);
}
case
Item
:
:
REF_ITEM
:
if
(
((
Item_ref
*
)
item
)
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
)
if
(
item
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
)
{
Item_field
*
field
=
(
Item_field
*
)
*
((
Item_ref
*
)
item
)
->
ref
;
Field
*
new_field
=
create_tmp_field_from_field
(
thd
,
...
...
tests/mysql_client_test.c
View file @
303dafc5
...
...
@@ -13156,14 +13156,24 @@ static void test_bug11111()
char
buf
[
2
][
20
];
long
len
[
2
];
int
i
;
int
rc
;
const
char
*
query
=
"SELECT DISTINCT f1,ff2 FROM v1"
;
myheader
(
"test_bug11111"
);
mysql_query
(
mysql
,
"drop table if exists t1, t2, v1"
);
mysql_query
(
mysql
,
"create table t1 (f1 int, f2 int)"
);
mysql_query
(
mysql
,
"create table t2 (ff1 int, ff2 int)"
);
mysql_query
(
mysql
,
"create view v1 as select * from t1, t2 where f1=ff1"
);
mysql_query
(
mysql
,
"insert into t1 values (1,1), (2,2), (3,3)"
);
mysql_query
(
mysql
,
"insert into t2 values (1,1), (2,2), (3,3)"
);
rc
=
mysql_query
(
mysql
,
"drop table if exists t1, t2, v1"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"drop view if exists t1, t2, v1"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"create table t1 (f1 int, f2 int)"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"create table t2 (ff1 int, ff2 int)"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"create view v1 as select * from t1, t2 where f1=ff1"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"insert into t1 values (1,1), (2,2), (3,3)"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"insert into t2 values (1,1), (2,2), (3,3)"
);
myquery
(
rc
);
stmt
=
mysql_stmt_init
(
mysql
);
...
...
@@ -13176,15 +13186,19 @@ static void test_bug11111()
bind
[
i
].
buffer
=
(
gptr
*
)
&
buf
[
i
];
bind
[
i
].
buffer_length
=
20
;
bind
[
i
].
length
=
&
len
[
i
];
}
}
if
(
mysql_stmt_bind_result
(
stmt
,
bind
))
printf
(
"Error: %s
\n
"
,
mysql_stmt_error
(
stmt
));
mysql_stmt_fetch
(
stmt
);
DIE_UNLESS
(
!
strcmp
(
buf
[
1
],
"1"
));
printf
(
"return: %s"
,
buf
[
1
]);
DIE_UNLESS
(
!
strcmp
(
buf
[
1
],
"1"
));
mysql_stmt_close
(
stmt
);
mysql_query
(
mysql
,
"drop table t1, t2, v1"
);
rc
=
mysql_query
(
mysql
,
"drop view v1"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"drop table t1, t2"
);
myquery
(
rc
);
}
/*
...
...
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