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
de84d762
Commit
de84d762
authored
Dec 12, 2005
by
anozdrin@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge WL#2984
parent
5d105fb7
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
130 additions
and
93 deletions
+130
-93
mysql-test/r/sp-vars.result
mysql-test/r/sp-vars.result
+76
-76
mysql-test/r/sp.result
mysql-test/r/sp.result
+1
-1
mysql-test/r/type_newdecimal-big.result
mysql-test/r/type_newdecimal-big.result
+23
-8
mysql-test/t/type_newdecimal-big.test
mysql-test/t/type_newdecimal-big.test
+25
-6
sql/sp_head.cc
sql/sp_head.cc
+3
-0
sql/sql_select.cc
sql/sql_select.cc
+2
-2
No files found.
mysql-test/r/sp-vars.result
View file @
de84d762
This diff is collapsed.
Click to expand it.
mysql-test/r/sp.result
View file @
de84d762
...
...
@@ -3537,7 +3537,7 @@ tm1 CREATE TEMPORARY TABLE `tm1` (
`spv1` decimal(3,3) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
Warnings:
Warning 1264 Out of range value
adjusted
for column 'spv1' at row 1
Warning 1264 Out of range value for column 'spv1' at row 1
Warning 1366 Incorrect decimal value: 'test' for column 'spv1' at row 1
call bug12589_2()|
Table Create Table
...
...
mysql-test/r/type_newdecimal-big.result
View file @
de84d762
drop procedure if exists sp1;
create procedure sp1 () begin
declare v1, v2, v3, v4 decimal(16,12); declare v5 int;
set v1 = 1; set v2 = 2; set v3 = 1000000000000; set v4 = 2000000000000; set v5 = 0;
while v5 < 100000 do
set v1 = v1 + 0.000000000001; set v2 = v2 - 0.000000000001; set v3 = v3 + 1; set v4 = v4 - 1; set v5 = v5 + 1;
end while; select v1, v2, v3 * 0.000000000001, v4 * 0.000000000001; end;//
CREATE PROCEDURE sp1()
BEGIN
DECLARE v1, v2, v3, v4 DECIMAL(28,12);
DECLARE v3_2, v4_2 DECIMAL(28, 12);
DECLARE counter INT;
SET v1 = 1;
SET v2 = 2;
SET v3 = 1000000000000;
SET v4 = 2000000000000;
SET counter = 0;
WHILE counter < 100000 DO
SET v1 = v1 + 0.000000000001;
SET v2 = v2 - 0.000000000001;
SET v3 = v3 + 1;
SET v4 = v4 - 1;
SET counter = counter + 1;
END WHILE;
SET v3_2 = v3 * 0.000000000001;
SET v4_2 = v4 * 0.000000000001;
SELECT v1, v2, v3, v3_2, v4, v4_2;
END//
call sp1()//
v1 v2 v3
* 0.000000000001 v4 * 0.000000000001
1.000000100000 1.999999900000 1
.0000001
00000 1.999999900000
v1 v2 v3
v3_2 v4 v4_2
1.000000100000 1.999999900000 1
000000100000.000000000000 1.000000100000 1999999900000.0000000
00000 1.999999900000
drop procedure sp1;
mysql-test/t/type_newdecimal-big.test
View file @
de84d762
...
...
@@ -12,12 +12,31 @@ drop procedure if exists sp1;
delimiter
//;
#
create
procedure
sp1
()
begin
declare
v1
,
v2
,
v3
,
v4
decimal
(
16
,
12
);
declare
v5
int
;
set
v1
=
1
;
set
v2
=
2
;
set
v3
=
1000000000000
;
set
v4
=
2000000000000
;
set
v5
=
0
;
while
v5
<
100000
do
set
v1
=
v1
+
0.000000000001
;
set
v2
=
v2
-
0.000000000001
;
set
v3
=
v3
+
1
;
set
v4
=
v4
-
1
;
set
v5
=
v5
+
1
;
end
while
;
select
v1
,
v2
,
v3
*
0.000000000001
,
v4
*
0.000000000001
;
end
;
//
CREATE
PROCEDURE
sp1
()
BEGIN
DECLARE
v1
,
v2
,
v3
,
v4
DECIMAL
(
28
,
12
);
DECLARE
v3_2
,
v4_2
DECIMAL
(
28
,
12
);
DECLARE
counter
INT
;
SET
v1
=
1
;
SET
v2
=
2
;
SET
v3
=
1000000000000
;
SET
v4
=
2000000000000
;
SET
counter
=
0
;
WHILE
counter
<
100000
DO
SET
v1
=
v1
+
0.000000000001
;
SET
v2
=
v2
-
0.000000000001
;
SET
v3
=
v3
+
1
;
SET
v4
=
v4
-
1
;
SET
counter
=
counter
+
1
;
END
WHILE
;
SET
v3_2
=
v3
*
0.000000000001
;
SET
v4_2
=
v4
*
0.000000000001
;
SELECT
v1
,
v2
,
v3
,
v3_2
,
v4
,
v4_2
;
END
//
#
call
sp1
()
//
#-- should return
...
...
sql/sp_head.cc
View file @
de84d762
...
...
@@ -680,6 +680,9 @@ sp_head::create_result_field(uint field_max_length, const char *field_name,
m_return_field_def
.
interval
,
field_name
?
field_name
:
(
const
char
*
)
m_name
.
str
);
if
(
field
)
field
->
init
(
table
);
DBUG_RETURN
(
field
);
}
...
...
sql/sql_select.cc
View file @
de84d762
...
...
@@ -8997,8 +8997,8 @@ TABLE *create_virtual_tmp_table(THD *thd, List<create_field> &field_list)
field
++
;
}
*
field
=
NULL
;
/* mark the end of the list */
s
->
blob_field
[
blob_count
]
=
0
;
/* mark the end of the list */
s
->
blob_fields
=
blob_count
;
s
hare
->
blob_field
[
blob_count
]
=
0
;
/* mark the end of the list */
s
hare
->
blob_fields
=
blob_count
;
null_pack_length
=
(
null_count
+
7
)
/
8
;
share
->
reclength
=
record_length
+
null_pack_length
;
...
...
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