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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
77dabba6
Commit
77dabba6
authored
Sep 28, 2007
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into moonbone.local:/work/27990-bug-5.0-opt-mysql
parents
fbdf00f0
b9e81c2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
22 deletions
+42
-22
sql/field.cc
sql/field.cc
+13
-3
sql/sql_select.cc
sql/sql_select.cc
+3
-0
tests/mysql_client_test.c
tests/mysql_client_test.c
+26
-19
No files found.
sql/field.cc
View file @
77dabba6
...
@@ -1356,15 +1356,25 @@ void Field_num::add_zerofill_and_unsigned(String &res) const
...
@@ -1356,15 +1356,25 @@ void Field_num::add_zerofill_and_unsigned(String &res) const
void
Field
::
make_field
(
Send_field
*
field
)
void
Field
::
make_field
(
Send_field
*
field
)
{
{
if
(
orig_table
->
s
->
table_cache_key
&&
*
(
orig_table
->
s
->
table_cache_key
))
if
(
orig_table
&&
orig_table
->
s
->
table_cache_key
&&
*
(
orig_table
->
s
->
table_cache_key
))
{
{
field
->
org_table_name
=
orig_table
->
s
->
table_name
;
field
->
org_table_name
=
orig_table
->
s
->
table_name
;
field
->
db_name
=
orig_table
->
s
->
table_cache_key
;
field
->
db_name
=
orig_table
->
s
->
table_cache_key
;
}
}
else
else
field
->
org_table_name
=
field
->
db_name
=
""
;
field
->
org_table_name
=
field
->
db_name
=
""
;
field
->
table_name
=
orig_table
->
alias
;
if
(
orig_table
)
field
->
col_name
=
field
->
org_col_name
=
field_name
;
{
field
->
table_name
=
orig_table
->
alias
;
field
->
org_col_name
=
field_name
;
}
else
{
field
->
table_name
=
""
;
field
->
org_col_name
=
""
;
}
field
->
col_name
=
field_name
;
field
->
charsetnr
=
charset
()
->
number
;
field
->
charsetnr
=
charset
()
->
number
;
field
->
length
=
field_length
;
field
->
length
=
field_length
;
field
->
type
=
type
();
field
->
type
=
type
();
...
...
sql/sql_select.cc
View file @
77dabba6
...
@@ -14330,6 +14330,9 @@ change_to_use_tmp_fields(THD *thd, Item **ref_pointer_array,
...
@@ -14330,6 +14330,9 @@ change_to_use_tmp_fields(THD *thd, Item **ref_pointer_array,
item_field
=
(
Item
*
)
new
Item_field
(
field
);
item_field
=
(
Item
*
)
new
Item_field
(
field
);
if
(
!
item_field
)
if
(
!
item_field
)
DBUG_RETURN
(
TRUE
);
// Fatal error
DBUG_RETURN
(
TRUE
);
// Fatal error
if
(
item
->
real_item
()
->
type
()
!=
Item
::
FIELD_ITEM
)
field
->
orig_table
=
0
;
item_field
->
name
=
item
->
name
;
item_field
->
name
=
item
->
name
;
if
(
item
->
type
()
==
Item
::
REF_ITEM
)
if
(
item
->
type
()
==
Item
::
REF_ITEM
)
{
{
...
...
tests/mysql_client_test.c
View file @
77dabba6
...
@@ -15490,7 +15490,7 @@ static void test_bug21635()
...
@@ -15490,7 +15490,7 @@ static void test_bug21635()
char
*
query_end
;
char
*
query_end
;
MYSQL_RES
*
result
;
MYSQL_RES
*
result
;
MYSQL_FIELD
*
field
;
MYSQL_FIELD
*
field
;
unsigned
int
field_count
,
i
;
unsigned
int
field_count
,
i
,
j
;
int
rc
;
int
rc
;
DBUG_ENTER
(
"test_bug21635"
);
DBUG_ENTER
(
"test_bug21635"
);
...
@@ -15506,28 +15506,35 @@ static void test_bug21635()
...
@@ -15506,28 +15506,35 @@ static void test_bug21635()
myquery
(
rc
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"CREATE TABLE t1 (i INT)"
);
rc
=
mysql_query
(
mysql
,
"CREATE TABLE t1 (i INT)"
);
myquery
(
rc
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"INSERT INTO t1 VALUES (1)"
);
/*
myquery
(
rc
);
We need this loop to ensure correct behavior with both constant and
non-constant tables.
*/
for
(
j
=
0
;
j
<
2
;
j
++
)
{
rc
=
mysql_query
(
mysql
,
"INSERT INTO t1 VALUES (1)"
);
myquery
(
rc
);
rc
=
mysql_real_query
(
mysql
,
query
,
query_end
-
query
);
rc
=
mysql_real_query
(
mysql
,
query
,
query_end
-
query
);
myquery
(
rc
);
myquery
(
rc
);
result
=
mysql_use_result
(
mysql
);
result
=
mysql_use_result
(
mysql
);
DIE_UNLESS
(
result
);
DIE_UNLESS
(
result
);
field_count
=
mysql_field_count
(
mysql
);
field_count
=
mysql_field_count
(
mysql
);
for
(
i
=
0
;
i
<
field_count
;
++
i
)
for
(
i
=
0
;
i
<
field_count
;
++
i
)
{
{
field
=
mysql_fetch_field_direct
(
result
,
i
);
field
=
mysql_fetch_field_direct
(
result
,
i
);
printf
(
"%s -> %s ... "
,
expr
[
i
*
2
],
field
->
name
);
printf
(
"%s -> %s ... "
,
expr
[
i
*
2
],
field
->
name
);
fflush
(
stdout
);
fflush
(
stdout
);
DIE_UNLESS
(
field
->
db
[
0
]
==
0
&&
field
->
org_table
[
0
]
==
0
&&
DIE_UNLESS
(
field
->
db
[
0
]
==
0
&&
field
->
org_table
[
0
]
==
0
&&
field
->
table
[
0
]
==
0
&&
field
->
org_name
[
0
]
==
0
);
field
->
table
[
0
]
==
0
&&
field
->
org_name
[
0
]
==
0
);
DIE_UNLESS
(
strcmp
(
field
->
name
,
expr
[
i
*
2
+
1
])
==
0
);
DIE_UNLESS
(
strcmp
(
field
->
name
,
expr
[
i
*
2
+
1
])
==
0
);
puts
(
"OK"
);
puts
(
"OK"
);
}
}
mysql_free_result
(
result
);
mysql_free_result
(
result
);
}
rc
=
mysql_query
(
mysql
,
"DROP TABLE t1"
);
rc
=
mysql_query
(
mysql
,
"DROP TABLE t1"
);
myquery
(
rc
);
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