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
87612b52
Commit
87612b52
authored
Mar 23, 2004
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into deer.(none):/home/hf/work/mysql-4.1.3266
parents
ea2c1609
7ab1c210
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
mysql-test/r/create.result
mysql-test/r/create.result
+11
-0
mysql-test/t/create.test
mysql-test/t/create.test
+14
-0
sql/item.cc
sql/item.cc
+2
-2
No files found.
mysql-test/r/create.result
View file @
87612b52
...
...
@@ -529,3 +529,14 @@ t5 CREATE TABLE `t5` (
KEY `PRIMARY_2` (`PRIMARY`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1, t2, t3, t4, t5;
CREATE TABLE t1(id varchar(10) NOT NULL PRIMARY KEY, dsc longtext);
INSERT INTO t1 VALUES ('5000000001', NULL),('5000000003', 'Test'),('5000000004', NULL);
CREATE TABLE t2(id varchar(15) NOT NULL, proc varchar(100) NOT NULL, runID varchar(16) NOT NULL, start datetime NOT NULL, PRIMARY KEY (id,proc,runID,start));
INSERT INTO t2 VALUES ('5000000001', 'proc01', '20031029090650', '2003-10-29 13:38:40'),('5000000001', 'proc02', '20031029090650', '2003-10-29 13:38:51'),('5000000001', 'proc03', '20031029090650', '2003-10-29 13:38:11'),('5000000002', 'proc09', '20031024013310', '2003-10-24 01:33:11'),('5000000002', 'proc09', '20031024153537', '2003-10-24 15:36:04'),('5000000004', 'proc01', '20031024013641', '2003-10-24 01:37:29'),('5000000004', 'proc02', '20031024013641', '2003-10-24 01:37:39');
CREATE TABLE t3 SELECT t1.dsc,COUNT(DISTINCT t2.id) AS countOfRuns FROM t1 LEFT JOIN t2 ON (t1.id=t2.id) GROUP BY t1.id;
SELECT * FROM t3;
dsc countOfRuns
NULL 1
Test 0
NULL 1
drop table t1, t2, t3;
mysql-test/t/create.test
View file @
87612b52
...
...
@@ -410,3 +410,17 @@ alter table t5 add index(`PRIMARY`);
show
create
table
t5
;
drop
table
t1
,
t2
,
t3
,
t4
,
t5
;
#
# bug #3266 TEXT in CREATE TABLE SELECT
#
CREATE
TABLE
t1
(
id
varchar
(
10
)
NOT
NULL
PRIMARY
KEY
,
dsc
longtext
);
INSERT
INTO
t1
VALUES
(
'5000000001'
,
NULL
),(
'5000000003'
,
'Test'
),(
'5000000004'
,
NULL
);
CREATE
TABLE
t2
(
id
varchar
(
15
)
NOT
NULL
,
proc
varchar
(
100
)
NOT
NULL
,
runID
varchar
(
16
)
NOT
NULL
,
start
datetime
NOT
NULL
,
PRIMARY
KEY
(
id
,
proc
,
runID
,
start
));
INSERT
INTO
t2
VALUES
(
'5000000001'
,
'proc01'
,
'20031029090650'
,
'2003-10-29 13:38:40'
),(
'5000000001'
,
'proc02'
,
'20031029090650'
,
'2003-10-29 13:38:51'
),(
'5000000001'
,
'proc03'
,
'20031029090650'
,
'2003-10-29 13:38:11'
),(
'5000000002'
,
'proc09'
,
'20031024013310'
,
'2003-10-24 01:33:11'
),(
'5000000002'
,
'proc09'
,
'20031024153537'
,
'2003-10-24 15:36:04'
),(
'5000000004'
,
'proc01'
,
'20031024013641'
,
'2003-10-24 01:37:29'
),(
'5000000004'
,
'proc02'
,
'20031024013641'
,
'2003-10-24 01:37:39'
);
CREATE
TABLE
t3
SELECT
t1
.
dsc
,
COUNT
(
DISTINCT
t2
.
id
)
AS
countOfRuns
FROM
t1
LEFT
JOIN
t2
ON
(
t1
.
id
=
t2
.
id
)
GROUP
BY
t1
.
id
;
SELECT
*
FROM
t3
;
drop
table
t1
,
t2
,
t3
;
sql/item.cc
View file @
87612b52
...
...
@@ -1284,8 +1284,8 @@ int Item::save_in_field(Field *field, bool no_conversions)
String
*
result
;
CHARSET_INFO
*
cs
=
collation
.
collation
;
char
buff
[
MAX_FIELD_WIDTH
];
// Alloc buffer for small columns
str_value
.
set_quick
(
buff
,
sizeof
(
buff
),
cs
);
result
=
val_str
(
&
str
_value
);
String
loc_value
(
buff
,
sizeof
(
buff
),
cs
);
result
=
val_str
(
&
loc
_value
);
if
(
null_value
)
return
set_field_to_null_with_conversions
(
field
,
no_conversions
);
field
->
set_notnull
();
...
...
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