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
dd7ecee5
Commit
dd7ecee5
authored
Feb 24, 2003
by
wax@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge vkishkin@work.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/wax/mysql-4n
parents
b2eb6eab
45ada603
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
2 deletions
+25
-2
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+5
-0
mysql-test/t/func_time.test
mysql-test/t/func_time.test
+4
-0
sql/mysqld.cc
sql/mysqld.cc
+7
-1
sql/set_var.cc
sql/set_var.cc
+4
-0
sql/sql_class.h
sql/sql_class.h
+1
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+4
-1
No files found.
mysql-test/r/func_time.result
View file @
dd7ecee5
...
@@ -96,6 +96,11 @@ week(19981231,2) week(19981231,3) week(20000101,2) week(20000101,3)
...
@@ -96,6 +96,11 @@ week(19981231,2) week(19981231,3) week(20000101,2) week(20000101,3)
select week(20001231,2),week(20001231,3);
select week(20001231,2),week(20001231,3);
week(20001231,2) week(20001231,3)
week(20001231,2) week(20001231,3)
1 52
1 52
set default_week_format = 2;
select week(20001231),week(20001231,2),week(20001231,0);
week(20001231) week(20001231,2) week(20001231,0)
1 1 53
set default_week_format = 0;
select date_format('1998-12-31','%x-%v'),date_format('1999-01-01','%x-%v');
select date_format('1998-12-31','%x-%v'),date_format('1999-01-01','%x-%v');
date_format('1998-12-31','%x-%v') date_format('1999-01-01','%x-%v')
date_format('1998-12-31','%x-%v') date_format('1999-01-01','%x-%v')
1998-53 1998-53
1998-53 1998-53
...
...
mysql-test/t/func_time.test
View file @
dd7ecee5
...
@@ -41,6 +41,10 @@ select yearweek("2000-01-06",1) as '2000', yearweek("2001-01-06",1) as '2001', y
...
@@ -41,6 +41,10 @@ select yearweek("2000-01-06",1) as '2000', yearweek("2001-01-06",1) as '2001', y
select
week
(
19981231
,
2
),
week
(
19981231
,
3
),
week
(
20000101
,
2
),
week
(
20000101
,
3
);
select
week
(
19981231
,
2
),
week
(
19981231
,
3
),
week
(
20000101
,
2
),
week
(
20000101
,
3
);
select
week
(
20001231
,
2
),
week
(
20001231
,
3
);
select
week
(
20001231
,
2
),
week
(
20001231
,
3
);
set
default_week_format
=
2
;
select
week
(
20001231
),
week
(
20001231
,
2
),
week
(
20001231
,
0
);
set
default_week_format
=
0
;
select
date_format
(
'1998-12-31'
,
'%x-%v'
),
date_format
(
'1999-01-01'
,
'%x-%v'
);
select
date_format
(
'1998-12-31'
,
'%x-%v'
),
date_format
(
'1999-01-01'
,
'%x-%v'
);
select
date_format
(
'1999-12-31'
,
'%x-%v'
),
date_format
(
'2000-01-01'
,
'%x-%v'
);
select
date_format
(
'1999-12-31'
,
'%x-%v'
),
date_format
(
'2000-01-01'
,
'%x-%v'
);
...
...
sql/mysqld.cc
View file @
dd7ecee5
...
@@ -3469,7 +3469,8 @@ enum options
...
@@ -3469,7 +3469,8 @@ enum options
OPT_ERROR_LOG_FILE
,
OPT_ERROR_LOG_FILE
,
OPT_ENABLE_SHARED_MEMORY
,
OPT_ENABLE_SHARED_MEMORY
,
OPT_SHARED_MEMORY_BASE_NAME
,
OPT_SHARED_MEMORY_BASE_NAME
,
OPT_OLD_PASSWORDS
OPT_OLD_PASSWORDS
,
OPT_DEFAULT_WEEK_FORMAT
};
};
...
@@ -4286,6 +4287,11 @@ struct my_option my_long_options[] =
...
@@ -4286,6 +4287,11 @@ struct my_option my_long_options[] =
(
gptr
*
)
&
global_system_variables
.
net_wait_timeout
,
(
gptr
*
)
&
global_system_variables
.
net_wait_timeout
,
(
gptr
*
)
&
max_system_variables
.
net_wait_timeout
,
0
,
GET_ULONG
,
(
gptr
*
)
&
max_system_variables
.
net_wait_timeout
,
0
,
GET_ULONG
,
REQUIRED_ARG
,
NET_WAIT_TIMEOUT
,
1
,
LONG_TIMEOUT
,
0
,
1
,
0
},
REQUIRED_ARG
,
NET_WAIT_TIMEOUT
,
1
,
LONG_TIMEOUT
,
0
,
1
,
0
},
{
"default-week-format"
,
OPT_DEFAULT_WEEK_FORMAT
,
"The default week format used by WEEK() functions."
,
(
gptr
*
)
&
global_system_variables
.
default_week_format
,
(
gptr
*
)
&
max_system_variables
.
default_week_format
,
0
,
GET_ULONG
,
REQUIRED_ARG
,
0
,
0
,
3L
,
0
,
1
,
0
},
{
0
,
0
,
0
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
}
{
0
,
0
,
0
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
}
};
};
...
...
sql/set_var.cc
View file @
dd7ecee5
...
@@ -311,6 +311,8 @@ static sys_var_slave_skip_counter sys_slave_skip_counter("sql_slave_skip_counter
...
@@ -311,6 +311,8 @@ static sys_var_slave_skip_counter sys_slave_skip_counter("sql_slave_skip_counter
static
sys_var_rand_seed1
sys_rand_seed1
(
"rand_seed1"
);
static
sys_var_rand_seed1
sys_rand_seed1
(
"rand_seed1"
);
static
sys_var_rand_seed2
sys_rand_seed2
(
"rand_seed2"
);
static
sys_var_rand_seed2
sys_rand_seed2
(
"rand_seed2"
);
static
sys_var_thd_ulong
sys_default_week_format
(
"default_week_format"
,
&
SV
::
default_week_format
);
/*
/*
List of all variables for initialisation and storage in hash
List of all variables for initialisation and storage in hash
...
@@ -332,6 +334,7 @@ sys_var *sys_variables[]=
...
@@ -332,6 +334,7 @@ sys_var *sys_variables[]=
&
sys_concurrent_insert
,
&
sys_concurrent_insert
,
&
sys_connect_timeout
,
&
sys_connect_timeout
,
&
sys_convert_charset
,
&
sys_convert_charset
,
&
sys_default_week_format
,
&
sys_delay_key_write
,
&
sys_delay_key_write
,
&
sys_delayed_insert_limit
,
&
sys_delayed_insert_limit
,
&
sys_delayed_insert_timeout
,
&
sys_delayed_insert_timeout
,
...
@@ -438,6 +441,7 @@ struct show_var_st init_vars[]= {
...
@@ -438,6 +441,7 @@ struct show_var_st init_vars[]= {
{
sys_connect_timeout
.
name
,
(
char
*
)
&
sys_connect_timeout
,
SHOW_SYS
},
{
sys_connect_timeout
.
name
,
(
char
*
)
&
sys_connect_timeout
,
SHOW_SYS
},
{
sys_convert_charset
.
name
,
(
char
*
)
&
sys_convert_charset
,
SHOW_SYS
},
{
sys_convert_charset
.
name
,
(
char
*
)
&
sys_convert_charset
,
SHOW_SYS
},
{
"datadir"
,
mysql_real_data_home
,
SHOW_CHAR
},
{
"datadir"
,
mysql_real_data_home
,
SHOW_CHAR
},
{
"default_week_format"
,
(
char
*
)
&
sys_default_week_format
,
SHOW_SYS
},
{
sys_delay_key_write
.
name
,
(
char
*
)
&
sys_delay_key_write
,
SHOW_SYS
},
{
sys_delay_key_write
.
name
,
(
char
*
)
&
sys_delay_key_write
,
SHOW_SYS
},
{
sys_delayed_insert_limit
.
name
,
(
char
*
)
&
sys_delayed_insert_limit
,
SHOW_SYS
},
{
sys_delayed_insert_limit
.
name
,
(
char
*
)
&
sys_delayed_insert_limit
,
SHOW_SYS
},
{
sys_delayed_insert_timeout
.
name
,
(
char
*
)
&
sys_delayed_insert_timeout
,
SHOW_SYS
},
{
sys_delayed_insert_timeout
.
name
,
(
char
*
)
&
sys_delayed_insert_timeout
,
SHOW_SYS
},
...
...
sql/sql_class.h
View file @
dd7ecee5
...
@@ -387,6 +387,7 @@ struct system_variables
...
@@ -387,6 +387,7 @@ struct system_variables
ulong
tmp_table_size
;
ulong
tmp_table_size
;
ulong
tx_isolation
;
ulong
tx_isolation
;
ulong
sql_mode
;
ulong
sql_mode
;
ulong
default_week_format
;
/*
/*
In slave thread we need to know in behalf of which
In slave thread we need to know in behalf of which
...
...
sql/sql_yacc.yy
View file @
dd7ecee5
...
@@ -2422,7 +2422,10 @@ simple_expr:
...
@@ -2422,7 +2422,10 @@ simple_expr:
| USER '(' ')'
| USER '(' ')'
{ $$= new Item_func_user(); Lex->safe_to_cache_query=0; }
{ $$= new Item_func_user(); Lex->safe_to_cache_query=0; }
| WEEK_SYM '(' expr ')'
| WEEK_SYM '(' expr ')'
{ $$= new Item_func_week($3,new Item_int((char*) "0",0,1)); }
{
$$= new Item_func_week($3,new Item_int((char*) "0",
YYTHD->variables.default_week_format,1));
}
| WEEK_SYM '(' expr ',' expr ')'
| WEEK_SYM '(' expr ',' expr ')'
{ $$= new Item_func_week($3,$5); }
{ $$= new Item_func_week($3,$5); }
| YEAR_SYM '(' expr ')'
| YEAR_SYM '(' expr ')'
...
...
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