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
5b540f05
Commit
5b540f05
authored
Mar 18, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WL#1648 - Start/Stop Inserting Duplicates Into a Table
parent
bffc3339
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
1 deletion
+70
-1
heap/hp_extra.c
heap/hp_extra.c
+33
-0
include/my_base.h
include/my_base.h
+6
-1
myisam/mi_extra.c
myisam/mi_extra.c
+31
-0
No files found.
heap/hp_extra.c
View file @
5b540f05
...
...
@@ -21,6 +21,10 @@
#include "heapdef.h"
static
void
heap_extra_keyflag
(
register
HP_INFO
*
info
,
enum
ha_extra_function
function
);
/* set extra flags for database */
int
heap_extra
(
register
HP_INFO
*
info
,
enum
ha_extra_function
function
)
...
...
@@ -41,8 +45,37 @@ int heap_extra(register HP_INFO *info, enum ha_extra_function function)
case
HA_EXTRA_READCHECK
:
info
->
opt_flag
|=
READ_CHECK_USED
;
break
;
case
HA_EXTRA_CHANGE_KEY_TO_UNIQUE
:
case
HA_EXTRA_CHANGE_KEY_TO_DUP
:
heap_extra_keyflag
(
info
,
function
);
break
;
default:
break
;
}
DBUG_RETURN
(
0
);
}
/* heap_extra */
/*
Start/Stop Inserting Duplicates Into a Table, WL#1648.
*/
static
void
heap_extra_keyflag
(
register
HP_INFO
*
info
,
enum
ha_extra_function
function
)
{
uint
idx
;
for
(
idx
=
0
;
idx
<
info
->
s
->
keys
;
idx
++
)
{
switch
(
function
)
{
case
HA_EXTRA_CHANGE_KEY_TO_UNIQUE
:
info
->
s
->
keydef
[
idx
].
flag
|=
HA_NOSAME
;
break
;
case
HA_EXTRA_CHANGE_KEY_TO_DUP
:
info
->
s
->
keydef
[
idx
].
flag
&=
~
(
HA_NOSAME
);
break
;
default:
break
;
}
}
}
include/my_base.h
View file @
5b540f05
...
...
@@ -141,7 +141,12 @@ enum ha_extra_function {
HA_EXTRA_RETRIEVE_PRIMARY_KEY
,
HA_EXTRA_PREPARE_FOR_DELETE
,
HA_EXTRA_PREPARE_FOR_UPDATE
,
/* Remove read cache if problems */
HA_EXTRA_PRELOAD_BUFFER_SIZE
/* Set buffer size for preloading */
HA_EXTRA_PRELOAD_BUFFER_SIZE
,
/* Set buffer size for preloading */
/*
On-the-fly switching between unique and non-unique key inserting.
*/
HA_EXTRA_CHANGE_KEY_TO_UNIQUE
,
HA_EXTRA_CHANGE_KEY_TO_DUP
};
/* The following is parameter to ha_panic() */
...
...
myisam/mi_extra.c
View file @
5b540f05
...
...
@@ -19,6 +19,9 @@
#include <sys/mman.h>
#endif
static
void
mi_extra_keyflag
(
MI_INFO
*
info
,
enum
ha_extra_function
function
);
/*
Set options and buffers to optimize table handling
...
...
@@ -355,6 +358,10 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
case
HA_EXTRA_PRELOAD_BUFFER_SIZE
:
info
->
preload_buff_size
=
*
((
ulong
*
)
extra_arg
);
break
;
case
HA_EXTRA_CHANGE_KEY_TO_UNIQUE
:
case
HA_EXTRA_CHANGE_KEY_TO_DUP
:
mi_extra_keyflag
(
info
,
function
);
break
;
case
HA_EXTRA_KEY_CACHE
:
case
HA_EXTRA_NO_KEY_CACHE
:
default:
...
...
@@ -367,3 +374,27 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
}
DBUG_RETURN
(
error
);
}
/* mi_extra */
/*
Start/Stop Inserting Duplicates Into a Table, WL#1648.
*/
static
void
mi_extra_keyflag
(
MI_INFO
*
info
,
enum
ha_extra_function
function
)
{
uint
idx
;
for
(
idx
=
0
;
idx
<
info
->
s
->
base
.
keys
;
idx
++
)
{
switch
(
function
)
{
case
HA_EXTRA_CHANGE_KEY_TO_UNIQUE
:
info
->
s
->
keyinfo
[
idx
].
flag
|=
HA_NOSAME
;
break
;
case
HA_EXTRA_CHANGE_KEY_TO_DUP
:
info
->
s
->
keyinfo
[
idx
].
flag
&=
~
(
HA_NOSAME
);
break
;
default:
break
;
}
}
}
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