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
91ae1258
Commit
91ae1258
authored
Apr 07, 2017
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-12471: BULK Command
BULK execution moved to a new command.
parent
e813fe86
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
191 additions
and
83 deletions
+191
-83
include/mysql.h.pp
include/mysql.h.pp
+2
-1
include/mysql_com.h
include/mysql_com.h
+11
-2
mysql-test/r/mysqld--help.result
mysql-test/r/mysqld--help.result
+1
-1
mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
+2
-2
mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
...l-test/suite/sys_vars/r/sysvars_server_notembedded.result
+2
-2
sql/item.cc
sql/item.cc
+1
-1
sql/item.h
sql/item.h
+1
-3
sql/sql_insert.cc
sql/sql_insert.cc
+5
-5
sql/sql_parse.cc
sql/sql_parse.cc
+6
-1
sql/sql_prepare.cc
sql/sql_prepare.cc
+158
-64
sql/sql_prepare.h
sql/sql_prepare.h
+2
-1
No files found.
include/mysql.h.pp
View file @
91ae1258
...
...
@@ -12,7 +12,8 @@ enum enum_server_command
COM_UNIMPLEMENTED
,
COM_RESET_CONNECTION
,
COM_MDB_GAP_BEG
,
COM_MDB_GAP_END
=
250
,
COM_MDB_GAP_END
=
249
,
COM_STMT_BULK_EXECUTE
=
250
,
COM_SLAVE_WORKER
=
251
,
COM_SLAVE_IO
=
252
,
COM_SLAVE_SQL
=
253
,
...
...
include/mysql_com.h
View file @
91ae1258
...
...
@@ -115,7 +115,8 @@ enum enum_server_command
COM_RESET_CONNECTION
,
/* don't forget to update const char *command_name[] in sql_parse.cc */
COM_MDB_GAP_BEG
,
COM_MDB_GAP_END
=
250
,
COM_MDB_GAP_END
=
249
,
COM_STMT_BULK_EXECUTE
=
250
,
COM_SLAVE_WORKER
=
251
,
COM_SLAVE_IO
=
252
,
COM_SLAVE_SQL
=
253
,
...
...
@@ -136,6 +137,13 @@ enum enum_indicator_type
STMT_INDICATOR_IGNORE
};
/*
bulk PS flags
*/
#define STMT_BULK_FLAG_CLIENT_SEND_TYPES 128
#define STMT_BULK_FLAG_INSERT_ID_REQUEST 64
/* sql type stored in .frm files for virtual fields */
#define MYSQL_TYPE_VIRTUAL 245
/*
...
...
@@ -311,7 +319,8 @@ enum enum_indicator_type
CLIENT_SESSION_TRACK |\
CLIENT_DEPRECATE_EOF |\
CLIENT_CONNECT_ATTRS |\
MARIADB_CLIENT_COM_MULTI)
MARIADB_CLIENT_COM_MULTI |\
MARIADB_CLIENT_STMT_BULK_OPERATIONS)
/*
To be added later:
...
...
mysql-test/r/mysqld--help.result
View file @
91ae1258
...
...
@@ -1396,7 +1396,7 @@ performance-schema-max-rwlock-instances -1
performance-schema-max-socket-classes 10
performance-schema-max-socket-instances -1
performance-schema-max-stage-classes 150
performance-schema-max-statement-classes 18
7
performance-schema-max-statement-classes 18
8
performance-schema-max-table-handles -1
performance-schema-max-table-instances -1
performance-schema-max-thread-classes 50
...
...
mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
View file @
91ae1258
...
...
@@ -2867,9 +2867,9 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES
SESSION_VALUE NULL
GLOBAL_VALUE 18
7
GLOBAL_VALUE 18
8
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 18
7
DEFAULT_VALUE 18
8
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Maximum number of statement instruments.
...
...
mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
View file @
91ae1258
...
...
@@ -3063,9 +3063,9 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES
SESSION_VALUE NULL
GLOBAL_VALUE 18
7
GLOBAL_VALUE 18
8
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 18
7
DEFAULT_VALUE 18
8
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Maximum number of statement instruments.
...
...
sql/item.cc
View file @
91ae1258
...
...
@@ -3347,7 +3347,7 @@ Item_param::Item_param(THD *thd, uint pos_in_query_arg):
state
(
NO_VALUE
),
/* Don't pretend to be a literal unless value for this item is set. */
item_type
(
PARAM_ITEM
),
indicator
s
(
0
),
indicator
(
STMT_INDICATOR_NONE
),
indicator
(
STMT_INDICATOR_NONE
),
set_param_func
(
default_set_param_func
),
m_out_param_info
(
NULL
),
/*
...
...
sql/item.h
View file @
91ae1258
...
...
@@ -2873,10 +2873,8 @@ class Item_param :public Item_basic_value,
};
/*
Used for bulk protocol. Indicates if we should expect
indicators byte before value of the parameter
Used for bulk protocol only.
*/
my_bool
indicators
;
enum
enum_indicator_type
indicator
;
/*
...
...
sql/sql_insert.cc
View file @
91ae1258
...
...
@@ -697,9 +697,9 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
bool
using_bulk_insert
=
0
;
uint
value_count
;
ulong
counter
=
1
;
ulong
iteration
=
0
;
/* counter of iteration in bulk PS operation*/
ulonglong
iteration
=
0
;
ulonglong
id
;
ulong
bulk_iterations
=
bulk_parameters_iterations
(
thd
);
COPY_INFO
info
;
TABLE
*
table
=
0
;
List_iterator_fast
<
List_item
>
its
(
values_list
);
...
...
@@ -767,7 +767,6 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
DBUG_RETURN
(
TRUE
);
value_count
=
values
->
elements
;
DBUG_ASSERT
(
bulk_iterations
>
0
);
if
(
mysql_prepare_insert
(
thd
,
table_list
,
table
,
fields
,
values
,
update_fields
,
update_values
,
duplic
,
&
unused_conds
,
FALSE
))
...
...
@@ -939,6 +938,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
}
do
{
DBUG_PRINT
(
"info"
,
(
"iteration %llu"
,
iteration
));
if
(
iteration
&&
bulk_parameters_set
(
thd
))
goto
abort
;
...
...
@@ -1059,7 +1059,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
}
its
.
rewind
();
iteration
++
;
}
while
(
iteration
<
bulk_iterations
);
}
while
(
bulk_parameters_iterations
(
thd
)
);
values_loop_end:
free_underlaid_joins
(
thd
,
&
thd
->
lex
->
select_lex
);
...
...
@@ -1206,7 +1206,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
retval
=
thd
->
lex
->
explain
->
send_explain
(
thd
);
goto
abort
;
}
if
((
bulk_iterations
*
values_list
.
elements
)
==
1
&&
(
!
(
thd
->
variables
.
option_bits
&
OPTION_WARNINGS
)
||
if
((
iteration
*
values_list
.
elements
)
==
1
&&
(
!
(
thd
->
variables
.
option_bits
&
OPTION_WARNINGS
)
||
!
thd
->
cuted_fields
))
{
my_ok
(
thd
,
info
.
copied
+
info
.
deleted
+
...
...
sql/sql_parse.cc
View file @
91ae1258
...
...
@@ -391,7 +391,7 @@ const LEX_STRING command_name[257]={
{
0
,
0
},
//247
{
0
,
0
},
//248
{
0
,
0
},
//249
{
0
,
0
},
//250
{
C_STRING_WITH_LEN
(
"Bulk_execute"
)
},
//250
{
C_STRING_WITH_LEN
(
"Slave_worker"
)
},
//251
{
C_STRING_WITH_LEN
(
"Slave_IO"
)
},
//252
{
C_STRING_WITH_LEN
(
"Slave_SQL"
)
},
//253
...
...
@@ -1749,6 +1749,11 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
break
;
}
case
COM_STMT_BULK_EXECUTE
:
{
mysqld_stmt_bulk_execute
(
thd
,
packet
,
packet_length
);
break
;
}
case
COM_STMT_EXECUTE
:
{
mysqld_stmt_execute
(
thd
,
packet
,
packet_length
);
...
...
sql/sql_prepare.cc
View file @
91ae1258
This diff is collapsed.
Click to expand it.
sql/sql_prepare.h
View file @
91ae1258
...
...
@@ -72,6 +72,7 @@ class Reprepare_observer
void
mysqld_stmt_prepare
(
THD
*
thd
,
const
char
*
packet
,
uint
packet_length
);
void
mysqld_stmt_execute
(
THD
*
thd
,
char
*
packet
,
uint
packet_length
);
void
mysqld_stmt_execute_bulk
(
THD
*
thd
,
char
*
packet
,
uint
packet_length
);
void
mysqld_stmt_bulk_execute
(
THD
*
thd
,
char
*
packet
,
uint
packet_length
);
void
mysqld_stmt_close
(
THD
*
thd
,
char
*
packet
);
void
mysql_sql_stmt_prepare
(
THD
*
thd
);
...
...
@@ -83,7 +84,7 @@ void mysqld_stmt_reset(THD *thd, char *packet);
void
mysql_stmt_get_longdata
(
THD
*
thd
,
char
*
pos
,
ulong
packet_length
);
void
reinit_stmt_before_use
(
THD
*
thd
,
LEX
*
lex
);
ulong
bulk_parameters_iterations
(
THD
*
thd
);
my_bool
bulk_parameters_iterations
(
THD
*
thd
);
my_bool
bulk_parameters_set
(
THD
*
thd
);
/**
Execute a fragment of server code in an isolated context, so that
...
...
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