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
610cea3d
Commit
610cea3d
authored
Nov 17, 2022
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
Helper class to swicth to relaxed checks during field copy. Temporarily.
parent
ad27e95d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
20 deletions
+15
-20
mysql-test/main/olap.result
mysql-test/main/olap.result
+0
-1
mysql-test/main/olap.test
mysql-test/main/olap.test
+0
-4
mysql-test/main/type_date.result
mysql-test/main/type_date.result
+0
-1
mysql-test/main/type_date.test
mysql-test/main/type_date.test
+0
-4
sql/item.cc
sql/item.cc
+1
-5
sql/sql_class.h
sql/sql_class.h
+13
-0
sql/sql_select.h
sql/sql_select.h
+1
-5
No files found.
mysql-test/main/olap.result
View file @
610cea3d
drop table if exists t1,t2;
set @sav_dpi= @@div_precision_increment;
set div_precision_increment= 5;
show variables like 'div_precision_increment';
...
...
mysql-test/main/olap.test
View file @
610cea3d
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
set
@
sav_dpi
=
@@
div_precision_increment
;
set
div_precision_increment
=
5
;
show
variables
like
'div_precision_increment'
;
...
...
mysql-test/main/type_date.result
View file @
610cea3d
drop table if exists t1,t2;
create table t1 (a char(16), b date, c datetime);
insert into t1 SET a='test 2000-01-01', b='2000-01-01', c='2000-01-01';
select * from t1 where c = '2000-01-01';
...
...
mysql-test/main/type_date.test
View file @
610cea3d
#
# test of problem with date fields
#
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
create
table
t1
(
a
char
(
16
),
b
date
,
c
datetime
);
insert
into
t1
SET
a
=
'test 2000-01-01'
,
b
=
'2000-01-01'
,
c
=
'2000-01-01'
;
select
*
from
t1
where
c
=
'2000-01-01'
;
...
...
sql/item.cc
View file @
610cea3d
...
...
@@ -1472,12 +1472,8 @@ int Item::save_in_field_no_warnings(Field *field, bool no_conversions)
{
int
res
;
TABLE
*
table
=
field
->
table
;
THD
*
thd
=
table
->
in_use
;
Check_level_instant_set
check_level_save
(
thd
,
CHECK_FIELD_IGNORE
);
Sql_mode_save
sql_mode
(
thd
);
thd
->
variables
.
sql_mode
&=
~
(
MODE_NO_ZERO_IN_DATE
|
MODE_NO_ZERO_DATE
);
thd
->
variables
.
sql_mode
|=
MODE_INVALID_DATES
;
MY_BITMAP
*
old_map
=
dbug_tmp_use_all_columns
(
table
,
&
table
->
write_set
);
Use_relaxed_field_copy
urfc
(
table
->
in_use
);
res
=
save_in_field
(
field
,
no_conversions
);
dbug_tmp_restore_column_map
(
&
table
->
write_set
,
old_map
);
return
res
;
...
...
sql/sql_class.h
View file @
610cea3d
...
...
@@ -6881,6 +6881,19 @@ class Check_level_instant_set
};
class
Use_relaxed_field_copy
:
public
Sql_mode_save
,
public
Check_level_instant_set
{
public:
Use_relaxed_field_copy
(
THD
*
thd
)
:
Sql_mode_save
(
thd
),
Check_level_instant_set
(
thd
,
CHECK_FIELD_IGNORE
)
{
thd
->
variables
.
sql_mode
&=
~
(
MODE_NO_ZERO_IN_DATE
|
MODE_NO_ZERO_DATE
);
thd
->
variables
.
sql_mode
|=
MODE_INVALID_DATES
;
}
};
/**
This class resembles the SQL Standard schema qualified object name:
<schema qualified name> ::= [ <schema name> <period> ] <qualified identifier>
...
...
sql/sql_select.h
View file @
610cea3d
...
...
@@ -1914,11 +1914,7 @@ class store_key :public Sql_alloc
enum
store_key_result
copy
()
{
enum
store_key_result
result
;
THD
*
thd
=
to_field
->
table
->
in_use
;
Check_level_instant_set
check_level_save
(
thd
,
CHECK_FIELD_IGNORE
);
Sql_mode_save
sql_mode
(
thd
);
thd
->
variables
.
sql_mode
&=
~
(
MODE_NO_ZERO_IN_DATE
|
MODE_NO_ZERO_DATE
);
thd
->
variables
.
sql_mode
|=
MODE_INVALID_DATES
;
Use_relaxed_field_copy
urfc
(
to_field
->
table
->
in_use
);
result
=
copy_inner
();
return
result
;
}
...
...
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