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
35ca5a4f
Commit
35ca5a4f
authored
Apr 29, 2007
by
holyfoot/hf@mysql.com/hfmain.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merging fix
parent
2fcebef3
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
19 deletions
+54
-19
mysql-test/r/innodb_mysql.result
mysql-test/r/innodb_mysql.result
+1
-0
mysql-test/r/join.result
mysql-test/r/join.result
+0
-15
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+23
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+3
-2
sql/item_timefunc.cc
sql/item_timefunc.cc
+24
-1
sql/time.cc
sql/time.cc
+3
-1
No files found.
mysql-test/r/innodb_mysql.result
View file @
35ca5a4f
...
@@ -459,6 +459,7 @@ id c counter
...
@@ -459,6 +459,7 @@ id c counter
3 b 2
3 b 2
4 a 2
4 a 2
drop table t1;
drop table t1;
End of 5.0 tests
CREATE TABLE t1 (a int, b int);
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
insert into t1 values (1,1),(1,2);
CREATE TABLE t2 (primary key (a)) select * from t1;
CREATE TABLE t2 (primary key (a)) select * from t1;
...
...
mysql-test/r/join.result
View file @
35ca5a4f
...
@@ -847,19 +847,4 @@ select '^^: The above should be ~= 20 + cost(select * from t1). Value less than
...
@@ -847,19 +847,4 @@ select '^^: The above should be ~= 20 + cost(select * from t1). Value less than
Z
Z
^^: The above should be ~= 20 + cost(select * from t1). Value less than 20 is an error
^^: The above should be ~= 20 + cost(select * from t1). Value less than 20 is an error
drop table t1, t2;
drop table t1, t2;
CREATE TABLE t1 (ID INTEGER, Name VARCHAR(50));
CREATE TABLE t2 (Test_ID INTEGER);
CREATE VIEW v1 (Test_ID, Description) AS SELECT ID, Name FROM t1;
CREATE TABLE tv1 SELECT Description AS Name FROM v1 JOIN t2
USING (Test_ID);
DESCRIBE tv1;
Field Type Null Key Default Extra
Name varchar(50) YES NULL
CREATE TABLE tv2 SELECT Description AS Name FROM v1 JOIN t2
ON v1.Test_ID = t2.Test_ID;
DESCRIBE tv2;
Field Type Null Key Default Extra
Name varchar(50) YES NULL
DROP VIEW v1;
DROP TABLE t1,t2,tv1,tv2;
End of 5.0 tests.
End of 5.0 tests.
mysql-test/r/subselect.result
View file @
35ca5a4f
...
@@ -4035,6 +4035,29 @@ FROM t1;
...
@@ -4035,6 +4035,29 @@ FROM t1;
ERROR HY000: Invalid use of group function
ERROR HY000: Invalid use of group function
DROP TABLE t1,t2;
DROP TABLE t1,t2;
End of 5.0 tests.
End of 5.0 tests.
CREATE TABLE t1 (a int, b int);
INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a;
a
1
2
SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a;
a
SELECT a FROM t1 t0
WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a;
a
1
2
SET @@sql_mode='ansi';
SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a;
ERROR HY000: Invalid use of group function
SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 1 GROUP BY a;
ERROR HY000: Invalid use of group function
SELECT a FROM t1 t0
WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a;
ERROR HY000: Invalid use of group function
SET @@sql_mode=default;
DROP TABLE t1;
CREATE TABLE t1 (s1 char(1));
CREATE TABLE t1 (s1 char(1));
INSERT INTO t1 VALUES ('a');
INSERT INTO t1 VALUES ('a');
SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1);
SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1);
...
...
sql/item_cmpfunc.cc
View file @
35ca5a4f
...
@@ -619,8 +619,9 @@ get_date_from_str(THD *thd, String *str, timestamp_type warn_type,
...
@@ -619,8 +619,9 @@ get_date_from_str(THD *thd, String *str, timestamp_type warn_type,
if
(
error
||
*
error_arg
)
if
(
error
||
*
error_arg
)
{
{
make_truncated_value_warning
(
thd
,
str
->
ptr
(),
str
->
length
(),
warn_type
,
make_truncated_value_warning
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
warn_name
);
str
->
ptr
(),
str
->
length
(),
warn_type
,
warn_name
);
*
error_arg
=
TRUE
;
*
error_arg
=
TRUE
;
}
}
return
value
;
return
value
;
...
...
sql/item_timefunc.cc
View file @
35ca5a4f
...
@@ -2056,7 +2056,30 @@ bool Item_date_add_interval::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
...
@@ -2056,7 +2056,30 @@ bool Item_date_add_interval::get_date(MYSQL_TIME *ltime, uint fuzzy_date)
if
(
date_sub_interval
)
if
(
date_sub_interval
)
interval
.
neg
=
!
interval
.
neg
;
interval
.
neg
=
!
interval
.
neg
;
return
(
null_value
=
date_add_interval
(
ltime
,
int_type
,
interval
));
if
((
null_value
=
date_add_interval
(
ltime
,
int_type
,
interval
)))
return
1
;
/* Adjust cached_field_type according to the detected type. */
if
(
cached_field_type
==
MYSQL_TYPE_STRING
)
{
switch
(
ltime
->
time_type
)
{
case
MYSQL_TIMESTAMP_DATE
:
cached_field_type
=
MYSQL_TYPE_DATE
;
break
;
case
MYSQL_TIMESTAMP_DATETIME
:
cached_field_type
=
MYSQL_TYPE_DATETIME
;
break
;
case
MYSQL_TIMESTAMP_TIME
:
cached_field_type
=
MYSQL_TYPE_TIME
;
break
;
default:
/* Shouldn't get here. */
DBUG_ASSERT
(
0
);
break
;
}
}
return
0
;
}
}
...
...
sql/time.cc
View file @
35ca5a4f
...
@@ -860,8 +860,9 @@ bool date_add_interval(MYSQL_TIME *ltime, interval_type int_type, INTERVAL inter
...
@@ -860,8 +860,9 @@ bool date_add_interval(MYSQL_TIME *ltime, interval_type int_type, INTERVAL inter
}
}
break
;
break
;
default:
default:
return
1
;
goto
null_date
;
}
}
return
0
;
// Ok
return
0
;
// Ok
invalid_date:
invalid_date:
...
@@ -869,6 +870,7 @@ bool date_add_interval(MYSQL_TIME *ltime, interval_type int_type, INTERVAL inter
...
@@ -869,6 +870,7 @@ bool date_add_interval(MYSQL_TIME *ltime, interval_type int_type, INTERVAL inter
ER_DATETIME_FUNCTION_OVERFLOW
,
ER_DATETIME_FUNCTION_OVERFLOW
,
ER
(
ER_DATETIME_FUNCTION_OVERFLOW
),
ER
(
ER_DATETIME_FUNCTION_OVERFLOW
),
"datetime"
);
"datetime"
);
null_date:
return
1
;
return
1
;
}
}
...
...
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