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
83fff262
Commit
83fff262
authored
Apr 19, 2007
by
gkodinov/kgeorge@magare.gmz
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B27530-5.0-opt
parents
16223f0d
4202454b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
1 deletion
+88
-1
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+69
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+18
-0
sql/item_strfunc.h
sql/item_strfunc.h
+1
-1
No files found.
mysql-test/r/func_str.result
View file @
83fff262
...
...
@@ -1992,4 +1992,73 @@ abc
SELECT INSERT('abc', 6, 3, '1234');
INSERT('abc', 6, 3, '1234')
abc
CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT CRC32(a) AS C FROM t1;
INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
SELECT CRC32(a), COUNT(*) FROM t1 GROUP BY 1;
CRC32(a) COUNT(*)
450215437 1
498629140 1
1790921346 1
1842515611 1
2212294583 1
2226203566 1
2366072709 1
2707236321 1
4088798008 1
4194326291 1
SELECT CRC32(a), COUNT(*) FROM t1 GROUP BY 1 ORDER BY 1;
CRC32(a) COUNT(*)
450215437 1
498629140 1
1790921346 1
1842515611 1
2212294583 1
2226203566 1
2366072709 1
2707236321 1
4088798008 1
4194326291 1
SELECT * FROM (SELECT CRC32(a) FROM t1) t2;
CRC32(a)
2212294583
450215437
1842515611
4088798008
2226203566
498629140
1790921346
4194326291
2366072709
2707236321
CREATE TABLE t2 SELECT CRC32(a) FROM t1;
desc t2;
Field Type Null Key Default Extra
CRC32(a) int(10) unsigned YES NULL
SELECT * FROM v1;
C
2212294583
450215437
1842515611
4088798008
2226203566
498629140
1790921346
4194326291
2366072709
2707236321
SELECT * FROM (SELECT * FROM v1) x;
C
2212294583
450215437
1842515611
4088798008
2226203566
498629140
1790921346
4194326291
2366072709
2707236321
DROP TABLE t1, t2;
DROP VIEW v1;
End of 5.0 tests
mysql-test/t/func_str.test
View file @
83fff262
...
...
@@ -1058,4 +1058,22 @@ SELECT INSERT('abc', 4, 3, '1234');
SELECT
INSERT
(
'abc'
,
5
,
3
,
'1234'
);
SELECT
INSERT
(
'abc'
,
6
,
3
,
'1234'
);
#
# Bug #27530: Grouping on crc32, or create table select crc32
#
CREATE
TABLE
t1
(
a
INT
);
CREATE
VIEW
v1
AS
SELECT
CRC32
(
a
)
AS
C
FROM
t1
;
INSERT
INTO
t1
VALUES
(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
),(
9
),(
10
);
SELECT
CRC32
(
a
),
COUNT
(
*
)
FROM
t1
GROUP
BY
1
;
SELECT
CRC32
(
a
),
COUNT
(
*
)
FROM
t1
GROUP
BY
1
ORDER
BY
1
;
SELECT
*
FROM
(
SELECT
CRC32
(
a
)
FROM
t1
)
t2
;
CREATE
TABLE
t2
SELECT
CRC32
(
a
)
FROM
t1
;
desc
t2
;
SELECT
*
FROM
v1
;
SELECT
*
FROM
(
SELECT
*
FROM
v1
)
x
;
DROP
TABLE
t1
,
t2
;
DROP
VIEW
v1
;
--
echo
End
of
5.0
tests
sql/item_strfunc.h
View file @
83fff262
...
...
@@ -790,7 +790,7 @@ class Item_func_crc32 :public Item_int_func
{
String
value
;
public:
Item_func_crc32
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
Item_func_crc32
(
Item
*
a
)
:
Item_int_func
(
a
)
{
unsigned_flag
=
1
;
}
const
char
*
func_name
()
const
{
return
"crc32"
;
}
void
fix_length_and_dec
()
{
max_length
=
10
;
}
longlong
val_int
();
...
...
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