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
0a8f3e19
Commit
0a8f3e19
authored
Mar 06, 2003
by
guilhem@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix so that INSERT DELAYED cares about SQL_LOG_BIN=0 (bug #104)
parent
ea4f0c38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
11 deletions
+28
-11
sql/sql_insert.cc
sql/sql_insert.cc
+28
-11
No files found.
sql/sql_insert.cc
View file @
0a8f3e19
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
static
int
check_null_fields
(
THD
*
thd
,
TABLE
*
entry
);
static
int
check_null_fields
(
THD
*
thd
,
TABLE
*
entry
);
static
TABLE
*
delayed_get_table
(
THD
*
thd
,
TABLE_LIST
*
table_list
);
static
TABLE
*
delayed_get_table
(
THD
*
thd
,
TABLE_LIST
*
table_list
);
static
int
write_delayed
(
THD
*
thd
,
TABLE
*
table
,
enum_duplicates
dup
,
static
int
write_delayed
(
THD
*
thd
,
TABLE
*
table
,
enum_duplicates
dup
,
char
*
query
,
uint
query_length
,
bool
log_on
);
char
*
query
,
uint
query_length
,
int
log_on
);
static
void
end_delayed_insert
(
THD
*
thd
);
static
void
end_delayed_insert
(
THD
*
thd
);
extern
"C"
pthread_handler_decl
(
handle_delayed_insert
,
arg
);
extern
"C"
pthread_handler_decl
(
handle_delayed_insert
,
arg
);
static
void
unlink_blobs
(
register
TABLE
*
table
);
static
void
unlink_blobs
(
register
TABLE
*
table
);
...
@@ -38,6 +38,8 @@ static void unlink_blobs(register TABLE *table);
...
@@ -38,6 +38,8 @@ static void unlink_blobs(register TABLE *table);
#define my_safe_afree(ptr, size, min_length) if (size > min_length) my_free(ptr,MYF(0))
#define my_safe_afree(ptr, size, min_length) if (size > min_length) my_free(ptr,MYF(0))
#endif
#endif
#define DELAYED_LOG_UPDATE 1
#define DELAYED_LOG_BIN 2
/*
/*
Check if insert fields are correct
Check if insert fields are correct
...
@@ -103,8 +105,13 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
...
@@ -103,8 +105,13 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
List
<
List_item
>
&
values_list
,
enum_duplicates
duplic
)
List
<
List_item
>
&
values_list
,
enum_duplicates
duplic
)
{
{
int
error
;
int
error
;
bool
log_on
=
((
thd
->
options
&
OPTION_UPDATE_LOG
)
||
/*
!
(
thd
->
master_access
&
SUPER_ACL
));
log_on is about delayed inserts only.
By default, both logs are enabled (this won't cause problems if the server
runs without --log-update or --log-bin).
*/
int
log_on
=
DELAYED_LOG_UPDATE
|
DELAYED_LOG_BIN
;
bool
transactional_table
,
log_delayed
,
bulk_insert
;
bool
transactional_table
,
log_delayed
,
bulk_insert
;
uint
value_count
;
uint
value_count
;
ulong
counter
=
1
;
ulong
counter
=
1
;
...
@@ -117,6 +124,14 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
...
@@ -117,6 +124,14 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
thr_lock_type
lock_type
=
table_list
->
lock_type
;
thr_lock_type
lock_type
=
table_list
->
lock_type
;
DBUG_ENTER
(
"mysql_insert"
);
DBUG_ENTER
(
"mysql_insert"
);
if
(
thd
->
master_access
&
SUPER_ACL
)
{
if
(
!
(
thd
->
options
&
OPTION_UPDATE_LOG
))
log_on
&=
~
(
int
)
DELAYED_LOG_UPDATE
;
if
(
!
(
thd
->
options
&
OPTION_BIN_LOG
))
log_on
&=
~
(
int
)
DELAYED_LOG_BIN
;
}
/*
/*
in safe mode or with skip-new change delayed insert to be regular
in safe mode or with skip-new change delayed insert to be regular
if we are told to replace duplicates, the insert cannot be concurrent
if we are told to replace duplicates, the insert cannot be concurrent
...
@@ -494,12 +509,13 @@ public:
...
@@ -494,12 +509,13 @@ public:
char
*
record
,
*
query
;
char
*
record
,
*
query
;
enum_duplicates
dup
;
enum_duplicates
dup
;
time_t
start_time
;
time_t
start_time
;
bool
query_start_used
,
last_insert_id_used
,
insert_id_used
,
log_query
;
bool
query_start_used
,
last_insert_id_used
,
insert_id_used
;
int
log_query
;
ulonglong
last_insert_id
;
ulonglong
last_insert_id
;
ulong
time_stamp
;
ulong
time_stamp
;
uint
query_length
;
uint
query_length
;
delayed_row
(
enum_duplicates
dup_arg
,
bool
log_query_arg
)
delayed_row
(
enum_duplicates
dup_arg
,
int
log_query_arg
)
:
record
(
0
),
query
(
0
),
dup
(
dup_arg
),
log_query
(
log_query_arg
)
{}
:
record
(
0
),
query
(
0
),
dup
(
dup_arg
),
log_query
(
log_query_arg
)
{}
~
delayed_row
()
~
delayed_row
()
{
{
...
@@ -802,7 +818,7 @@ TABLE *delayed_insert::get_local_table(THD* client_thd)
...
@@ -802,7 +818,7 @@ TABLE *delayed_insert::get_local_table(THD* client_thd)
/* Put a question in queue */
/* Put a question in queue */
static
int
write_delayed
(
THD
*
thd
,
TABLE
*
table
,
enum_duplicates
duplic
,
static
int
write_delayed
(
THD
*
thd
,
TABLE
*
table
,
enum_duplicates
duplic
,
char
*
query
,
uint
query_length
,
bool
log_on
)
char
*
query
,
uint
query_length
,
int
log_on
)
{
{
delayed_row
*
row
=
0
;
delayed_row
*
row
=
0
;
delayed_insert
*
di
=
thd
->
di
;
delayed_insert
*
di
=
thd
->
di
;
...
@@ -1189,13 +1205,14 @@ bool delayed_insert::handle_inserts(void)
...
@@ -1189,13 +1205,14 @@ bool delayed_insert::handle_inserts(void)
using_ignore
=
0
;
using_ignore
=
0
;
table
->
file
->
extra
(
HA_EXTRA_NO_IGNORE_DUP_KEY
);
table
->
file
->
extra
(
HA_EXTRA_NO_IGNORE_DUP_KEY
);
}
}
if
(
row
->
query
&&
row
->
log_query
)
if
(
row
->
query
)
{
{
mysql_update_log
.
write
(
&
thd
,
row
->
query
,
row
->
query_length
);
if
(
row
->
log_query
&
DELAYED_LOG_UPDATE
)
if
(
using_bin_log
)
mysql_update_log
.
write
(
&
thd
,
row
->
query
,
row
->
query_length
);
if
(
row
->
log_query
&
DELAYED_LOG_BIN
&&
using_bin_log
)
{
{
Query_log_event
qinfo
(
&
thd
,
row
->
query
,
row
->
query_length
,
0
);
Query_log_event
qinfo
(
&
thd
,
row
->
query
,
row
->
query_length
,
0
);
mysql_bin_log
.
write
(
&
qinfo
);
mysql_bin_log
.
write
(
&
qinfo
);
}
}
}
}
if
(
table
->
blob_fields
)
if
(
table
->
blob_fields
)
...
...
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