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
17db9de5
Commit
17db9de5
authored
Jun 10, 2004
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/my/mysql-4.0
parents
4bd44185
ff223db0
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
18 deletions
+35
-18
mysql-test/r/type_date.result
mysql-test/r/type_date.result
+2
-13
mysql-test/t/type_date.test
mysql-test/t/type_date.test
+8
-0
sql/field.cc
sql/field.cc
+18
-0
sql/field.h
sql/field.h
+1
-0
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+0
-1
sql/sql_acl.cc
sql/sql_acl.cc
+2
-2
sql/sql_parse.cc
sql/sql_parse.cc
+4
-2
No files found.
mysql-test/r/type_date.result
View file @
17db9de5
...
@@ -60,16 +60,5 @@ select date_add(date,INTERVAL 1 DAY),date_add(date,INTERVAL 1 SECOND) from t1;
...
@@ -60,16 +60,5 @@ select date_add(date,INTERVAL 1 DAY),date_add(date,INTERVAL 1 SECOND) from t1;
date_add(date,INTERVAL 1 DAY) date_add(date,INTERVAL 1 SECOND)
date_add(date,INTERVAL 1 DAY) date_add(date,INTERVAL 1 SECOND)
2000-08-11 2000-08-10 00:00:01
2000-08-11 2000-08-10 00:00:01
2000-08-12 2000-08-11 00:00:01
2000-08-12 2000-08-11 00:00:01
drop table t1;
DATE_FORMAT(f1, "%l.%i %p") DATE_FORMAT(f2, "%l.%i %p")
CREATE TABLE t1(AFIELD INT);
9.00 AM 12.00 PM
INSERT INTO t1 VALUES(1);
CREATE TABLE t2(GMT VARCHAR(32));
INSERT INTO t2 VALUES('GMT-0800');
SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1, t2 GROUP BY t1.AFIELD;
DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT))
Wed, 06 March 2002 10:11:12 GMT-0800
INSERT INTO t1 VALUES(1);
SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)), DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) FROM t1,t2 GROUP BY t1.AFIELD;
DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT)) DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.GMT))
Wed, 06 March 2002 10:11:12 GMT-0800 Wed, 06 March 2002 10:11:12 GMT-0800
drop table t1,t2;
mysql-test/t/type_date.test
View file @
17db9de5
...
@@ -76,3 +76,11 @@ SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.
...
@@ -76,3 +76,11 @@ SELECT DATE_FORMAT("2002-03-06 10:11:12", CONCAT('%a, %d %M %Y %H:%i:%s ' , t2.
INSERT
INTO
t1
VALUES
(
1
);
INSERT
INTO
t1
VALUES
(
1
);
SELECT
DATE_FORMAT
(
"2002-03-06 10:11:12"
,
CONCAT
(
'%a, %d %M %Y %H:%i:%s '
,
t2
.
GMT
)),
DATE_FORMAT
(
"2002-03-06 10:11:12"
,
CONCAT
(
'%a, %d %M %Y %H:%i:%s '
,
t2
.
GMT
))
FROM
t1
,
t2
GROUP
BY
t1
.
AFIELD
;
SELECT
DATE_FORMAT
(
"2002-03-06 10:11:12"
,
CONCAT
(
'%a, %d %M %Y %H:%i:%s '
,
t2
.
GMT
)),
DATE_FORMAT
(
"2002-03-06 10:11:12"
,
CONCAT
(
'%a, %d %M %Y %H:%i:%s '
,
t2
.
GMT
))
FROM
t1
,
t2
GROUP
BY
t1
.
AFIELD
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# Bug 4036
#
CREATE
TABLE
t1
(
f1
time
default
NULL
,
f2
time
default
NULL
)
TYPE
=
MyISAM
;
INSERT
INTO
t1
(
f1
,
f2
)
VALUES
(
'09:00'
,
'12:00'
);
SELECT
DATE_FORMAT
(
f1
,
"%l.%i %p"
)
,
DATE_FORMAT
(
f2
,
"%l.%i %p"
)
FROM
t1
;
DROP
TABLE
t1
;
sql/field.cc
View file @
17db9de5
...
@@ -2960,6 +2960,24 @@ String *Field_time::val_str(String *val_buffer,
...
@@ -2960,6 +2960,24 @@ String *Field_time::val_str(String *val_buffer,
return
val_buffer
;
return
val_buffer
;
}
}
bool
Field_time
::
get_date
(
TIME
*
ltime
,
bool
fuzzydate
__attribute__
((
unused
)))
{
long
tmp
=
(
long
)
sint3korr
(
ptr
);
ltime
->
neg
=
0
;
if
(
tmp
<
0
)
{
ltime
->
neg
=
1
;
tmp
=-
tmp
;
}
ltime
->
hour
=
tmp
/
10000
;
tmp
-=
ltime
->
hour
*
10000
;
ltime
->
minute
=
tmp
/
100
;
ltime
->
second
=
tmp
%
100
;
ltime
->
year
=
ltime
->
month
=
ltime
->
day
=
ltime
->
second_part
=
0
;
return
0
;
}
bool
Field_time
::
get_time
(
TIME
*
ltime
)
bool
Field_time
::
get_time
(
TIME
*
ltime
)
{
{
long
tmp
=
(
long
)
sint3korr
(
ptr
);
long
tmp
=
(
long
)
sint3korr
(
ptr
);
...
...
sql/field.h
View file @
17db9de5
...
@@ -690,6 +690,7 @@ public:
...
@@ -690,6 +690,7 @@ public:
double
val_real
(
void
);
double
val_real
(
void
);
longlong
val_int
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
String
*
val_str
(
String
*
,
String
*
);
bool
get_date
(
TIME
*
ltime
,
bool
fuzzydate
);
bool
get_time
(
TIME
*
ltime
);
bool
get_time
(
TIME
*
ltime
);
int
cmp
(
const
char
*
,
const
char
*
);
int
cmp
(
const
char
*
,
const
char
*
);
void
sort_string
(
char
*
buff
,
uint
length
);
void
sort_string
(
char
*
buff
,
uint
length
);
...
...
sql/item_cmpfunc.h
View file @
17db9de5
...
@@ -583,7 +583,6 @@ public:
...
@@ -583,7 +583,6 @@ public:
Item_cond
()
:
Item_bool_func
(),
abort_on_null
(
1
)
{
const_item_cache
=
0
;
}
Item_cond
()
:
Item_bool_func
(),
abort_on_null
(
1
)
{
const_item_cache
=
0
;
}
Item_cond
(
Item
*
i1
,
Item
*
i2
)
:
Item_bool_func
(),
abort_on_null
(
0
)
Item_cond
(
Item
*
i1
,
Item
*
i2
)
:
Item_bool_func
(),
abort_on_null
(
0
)
{
list
.
push_back
(
i1
);
list
.
push_back
(
i2
);
}
{
list
.
push_back
(
i1
);
list
.
push_back
(
i2
);
}
~
Item_cond
()
{
list
.
delete_elements
();
}
bool
add
(
Item
*
item
)
{
return
list
.
push_back
(
item
);
}
bool
add
(
Item
*
item
)
{
return
list
.
push_back
(
item
);
}
bool
fix_fields
(
THD
*
,
struct
st_table_list
*
);
bool
fix_fields
(
THD
*
,
struct
st_table_list
*
);
...
...
sql/sql_acl.cc
View file @
17db9de5
...
@@ -2715,7 +2715,7 @@ bool check_grant_all_columns(THD *thd, ulong want_access, TABLE *table)
...
@@ -2715,7 +2715,7 @@ bool check_grant_all_columns(THD *thd, ulong want_access, TABLE *table)
if
(
table
->
grant
.
version
!=
grant_version
)
if
(
table
->
grant
.
version
!=
grant_version
)
{
{
table
->
grant
.
grant_table
=
table
->
grant
.
grant_table
=
table_hash_search
(
thd
->
host
,
thd
->
ip
,
thd
->
db
,
table_hash_search
(
thd
->
host
,
thd
->
ip
,
table
->
table_cache_key
,
thd
->
priv_user
,
thd
->
priv_user
,
table
->
real_name
,
0
);
/* purecov: inspected */
table
->
real_name
,
0
);
/* purecov: inspected */
table
->
grant
.
version
=
grant_version
;
/* purecov: inspected */
table
->
grant
.
version
=
grant_version
;
/* purecov: inspected */
...
@@ -2821,7 +2821,7 @@ ulong get_column_grant(THD *thd, TABLE_LIST *table, Field *field)
...
@@ -2821,7 +2821,7 @@ ulong get_column_grant(THD *thd, TABLE_LIST *table, Field *field)
if
(
table
->
grant
.
version
!=
grant_version
)
if
(
table
->
grant
.
version
!=
grant_version
)
{
{
table
->
grant
.
grant_table
=
table
->
grant
.
grant_table
=
table_hash_search
(
thd
->
host
,
thd
->
ip
,
thd
->
db
,
table_hash_search
(
thd
->
host
,
thd
->
ip
,
table
->
db
,
thd
->
priv_user
,
thd
->
priv_user
,
table
->
real_name
,
0
);
/* purecov: inspected */
table
->
real_name
,
0
);
/* purecov: inspected */
table
->
grant
.
version
=
grant_version
;
/* purecov: inspected */
table
->
grant
.
version
=
grant_version
;
/* purecov: inspected */
...
...
sql/sql_parse.cc
View file @
17db9de5
...
@@ -3158,10 +3158,12 @@ bool add_field_to_list(char *field_name, enum_field_types type,
...
@@ -3158,10 +3158,12 @@ bool add_field_to_list(char *field_name, enum_field_types type,
break
;
break
;
case
FIELD_TYPE_DECIMAL
:
case
FIELD_TYPE_DECIMAL
:
if
(
!
length
)
if
(
!
length
)
if
(
new_field
->
length
=
new_field
->
decimals
)
{
if
((
new_field
->
length
=
new_field
->
decimals
))
new_field
->
length
++
;
new_field
->
length
++
;
else
else
new_field
->
length
=
10
;
// Default length for DECIMAL
new_field
->
length
=
10
;
// Default length for DECIMAL
}
if
(
new_field
->
length
<
MAX_FIELD_WIDTH
)
// Skip wrong argument
if
(
new_field
->
length
<
MAX_FIELD_WIDTH
)
// Skip wrong argument
{
{
new_field
->
length
+=
sign_len
;
new_field
->
length
+=
sign_len
;
...
...
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