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
428f03c0
Commit
428f03c0
authored
Sep 24, 2015
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-8839 COLUMN_GET() produces warnings with no data
parent
e5418942
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
12 deletions
+39
-12
mysql-test/suite/vcol/r/vcol_misc.result
mysql-test/suite/vcol/r/vcol_misc.result
+19
-0
mysql-test/suite/vcol/t/vcol_misc.test
mysql-test/suite/vcol/t/vcol_misc.test
+9
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+11
-12
No files found.
mysql-test/suite/vcol/r/vcol_misc.result
View file @
428f03c0
...
@@ -346,5 +346,24 @@ t1 CREATE TABLE `t1` (
...
@@ -346,5 +346,24 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP TABLE t1;
#
#
# MDEV-8839 COLUMN_GET() produces warnings with no data
#
SET @aaa= COLUMN_CREATE('price', _binary 0xF0F1F2F3F4F5F6F7);
SELECT COLUMN_GET(@aaa, 'price' AS DECIMAL) aaa;
aaa
0
Warnings:
Warning 1918 Encountered illegal value '\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7' when converting to DECIMAL
SELECT COLUMN_GET(@aaa, 'price' AS INT) aaa;
aaa
0
Warnings:
Warning 1918 Encountered illegal value '\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7' when converting to INT
SELECT COLUMN_GET(@aaa, 'price' AS DOUBLE) aaa;
aaa
0
Warnings:
Warning 1918 Encountered illegal value '\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7' when converting to DOUBLE
#
# End of 10.1 tests
# End of 10.1 tests
#
#
mysql-test/suite/vcol/t/vcol_misc.test
View file @
428f03c0
...
@@ -302,6 +302,15 @@ CREATE TABLE t1 (a DATETIME, b TIMESTAMP AS (TIMESTAMP(a)),c TIMESTAMP);
...
@@ -302,6 +302,15 @@ CREATE TABLE t1 (a DATETIME, b TIMESTAMP AS (TIMESTAMP(a)),c TIMESTAMP);
SHOW
CREATE
TABLE
t1
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-8839 COLUMN_GET() produces warnings with no data
--
echo
#
SET
@
aaa
=
COLUMN_CREATE
(
'price'
,
_binary
0xF0F1F2F3F4F5F6F7
);
SELECT
COLUMN_GET
(
@
aaa
,
'price'
AS
DECIMAL
)
aaa
;
SELECT
COLUMN_GET
(
@
aaa
,
'price'
AS
INT
)
aaa
;
SELECT
COLUMN_GET
(
@
aaa
,
'price'
AS
DOUBLE
)
aaa
;
--
echo
#
--
echo
#
--
echo
# End of 10.1 tests
--
echo
# End of 10.1 tests
--
echo
#
--
echo
#
sql/item_strfunc.cc
View file @
428f03c0
...
@@ -4963,13 +4963,12 @@ longlong Item_dyncol_get::val_int()
...
@@ -4963,13 +4963,12 @@ longlong Item_dyncol_get::val_int()
if
(
end
!=
org_end
||
error
>
0
)
if
(
end
!=
org_end
||
error
>
0
)
{
{
THD
*
thd
=
current_thd
;
THD
*
thd
=
current_thd
;
char
buff
[
80
];
strmake
(
buff
,
val
.
x
.
string
.
value
.
str
,
MY_MIN
(
sizeof
(
buff
)
-
1
,
val
.
x
.
string
.
value
.
length
));
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
ER_BAD_DATA
,
ER_BAD_DATA
,
ER_THD
(
thd
,
ER_BAD_DATA
),
ER_THD
(
thd
,
ER_BAD_DATA
),
buff
,
ErrConvString
(
val
.
x
.
string
.
value
.
str
,
val
.
x
.
string
.
value
.
length
,
val
.
x
.
string
.
charset
).
ptr
(),
unsigned_flag
?
"UNSIGNED INT"
:
"INT"
);
unsigned_flag
?
"UNSIGNED INT"
:
"INT"
);
}
}
unsigned_flag
=
error
>=
0
;
unsigned_flag
=
error
>=
0
;
...
@@ -5028,13 +5027,13 @@ double Item_dyncol_get::val_real()
...
@@ -5028,13 +5027,13 @@ double Item_dyncol_get::val_real()
error
)
error
)
{
{
THD
*
thd
=
current_thd
;
THD
*
thd
=
current_thd
;
char
buff
[
80
];
strmake
(
buff
,
val
.
x
.
string
.
value
.
str
,
MY_MIN
(
sizeof
(
buff
)
-
1
,
val
.
x
.
string
.
value
.
length
));
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
ER_BAD_DATA
,
ER_BAD_DATA
,
ER_THD
(
thd
,
ER_BAD_DATA
),
ER_THD
(
thd
,
ER_BAD_DATA
),
buff
,
"DOUBLE"
);
ErrConvString
(
val
.
x
.
string
.
value
.
str
,
val
.
x
.
string
.
value
.
length
,
val
.
x
.
string
.
charset
).
ptr
(),
"DOUBLE"
);
}
}
return
res
;
return
res
;
}
}
...
@@ -5085,9 +5084,6 @@ my_decimal *Item_dyncol_get::val_decimal(my_decimal *decimal_value)
...
@@ -5085,9 +5084,6 @@ my_decimal *Item_dyncol_get::val_decimal(my_decimal *decimal_value)
int
rc
;
int
rc
;
rc
=
str2my_decimal
(
0
,
val
.
x
.
string
.
value
.
str
,
val
.
x
.
string
.
value
.
length
,
rc
=
str2my_decimal
(
0
,
val
.
x
.
string
.
value
.
str
,
val
.
x
.
string
.
value
.
length
,
val
.
x
.
string
.
charset
,
decimal_value
,
&
end
);
val
.
x
.
string
.
charset
,
decimal_value
,
&
end
);
char
buff
[
80
];
strmake
(
buff
,
val
.
x
.
string
.
value
.
str
,
MY_MIN
(
sizeof
(
buff
)
-
1
,
val
.
x
.
string
.
value
.
length
));
if
(
rc
!=
E_DEC_OK
||
if
(
rc
!=
E_DEC_OK
||
end
!=
val
.
x
.
string
.
value
.
str
+
val
.
x
.
string
.
value
.
length
)
end
!=
val
.
x
.
string
.
value
.
str
+
val
.
x
.
string
.
value
.
length
)
{
{
...
@@ -5095,7 +5091,10 @@ my_decimal *Item_dyncol_get::val_decimal(my_decimal *decimal_value)
...
@@ -5095,7 +5091,10 @@ my_decimal *Item_dyncol_get::val_decimal(my_decimal *decimal_value)
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
ER_BAD_DATA
,
ER_BAD_DATA
,
ER_THD
(
thd
,
ER_BAD_DATA
),
ER_THD
(
thd
,
ER_BAD_DATA
),
buff
,
"DECIMAL"
);
ErrConvString
(
val
.
x
.
string
.
value
.
str
,
val
.
x
.
string
.
value
.
length
,
val
.
x
.
string
.
charset
).
ptr
(),
"DECIMAL"
);
}
}
break
;
break
;
}
}
...
...
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