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
3831bb56
Commit
3831bb56
authored
Aug 22, 2005
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/11718-bug-4.1-mysql
parents
05fdd166
6d8bd17c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
1 deletion
+44
-1
sql/sql_select.cc
sql/sql_select.cc
+9
-1
tests/mysql_client_test.c
tests/mysql_client_test.c
+35
-0
No files found.
sql/sql_select.cc
View file @
3831bb56
...
@@ -4899,7 +4899,15 @@ static Field* create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
...
@@ -4899,7 +4899,15 @@ static Field* create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
item
->
name
,
table
,
item
->
unsigned_flag
);
item
->
name
,
table
,
item
->
unsigned_flag
);
break
;
break
;
case
STRING_RESULT
:
case
STRING_RESULT
:
if
(
item
->
max_length
>
255
)
enum
enum_field_types
type
;
/*
DATE/TIME fields have STRING_RESULT result type. To preserve
type they needed to be handled separately.
*/
if
((
type
=
item
->
field_type
())
==
MYSQL_TYPE_DATETIME
||
type
==
MYSQL_TYPE_TIME
||
type
==
MYSQL_TYPE_DATE
)
new_field
=
item
->
tmp_table_field_from_field_type
(
table
);
else
if
(
item
->
max_length
>
255
)
{
{
if
(
convert_blob_length
)
if
(
convert_blob_length
)
new_field
=
new
Field_varstring
(
convert_blob_length
,
maybe_null
,
new_field
=
new
Field_varstring
(
convert_blob_length
,
maybe_null
,
...
...
tests/mysql_client_test.c
View file @
3831bb56
...
@@ -11796,6 +11796,40 @@ static void test_bug12001()
...
@@ -11796,6 +11796,40 @@ static void test_bug12001()
DIE_UNLESS
(
res
==
1
);
DIE_UNLESS
(
res
==
1
);
}
}
/*
Bug#11718: query with function, join and order by returns wrong type
*/
static
void
test_bug11718
()
{
MYSQL_RES
*
res
;
int
rc
;
const
char
*
query
=
"select str_to_date(concat(f3),'%Y%m%d') from t1,t2 "
"where f1=f2 order by f1"
;
myheader
(
"test_bug11718"
);
rc
=
mysql_query
(
mysql
,
"drop table if exists t1, t2"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"create table t1 (f1 int)"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"create table t2 (f2 int, f3 numeric(8))"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"insert into t1 values (1), (2)"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"insert into t2 values (1,20050101), (2,20050202)"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
query
);
myquery
(
rc
);
res
=
mysql_store_result
(
mysql
);
if
(
!
opt_silent
)
printf
(
"return type: %s"
,
(
res
->
fields
[
0
].
type
==
MYSQL_TYPE_DATE
)
?
"DATE"
:
"not DATE"
);
DIE_UNLESS
(
res
->
fields
[
0
].
type
==
MYSQL_TYPE_DATE
);
rc
=
mysql_query
(
mysql
,
"drop table t1, t2"
);
myquery
(
rc
);
}
/*
/*
Read and parse arguments and MySQL options from my.cnf
Read and parse arguments and MySQL options from my.cnf
*/
*/
...
@@ -12013,6 +12047,7 @@ static struct my_tests_st my_tests[]= {
...
@@ -12013,6 +12047,7 @@ static struct my_tests_st my_tests[]= {
{
"test_bug9735"
,
test_bug9735
},
{
"test_bug9735"
,
test_bug9735
},
{
"test_bug11183"
,
test_bug11183
},
{
"test_bug11183"
,
test_bug11183
},
{
"test_bug12001"
,
test_bug12001
},
{
"test_bug12001"
,
test_bug12001
},
{
"test_bug11718"
,
test_bug11718
},
{
0
,
0
}
{
0
,
0
}
};
};
...
...
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