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
7216c3b2
Commit
7216c3b2
authored
Mar 18, 2004
by
ingo@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WL#1648 - Start/Stop Inserting Duplicates Into a Table
parent
1e0ccbd9
Changes
3
Show 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 @
7216c3b2
...
@@ -21,6 +21,10 @@
...
@@ -21,6 +21,10 @@
#include "heapdef.h"
#include "heapdef.h"
static
void
heap_extra_keyflag
(
register
HP_INFO
*
info
,
enum
ha_extra_function
function
);
/* set extra flags for database */
/* set extra flags for database */
int
heap_extra
(
register
HP_INFO
*
info
,
enum
ha_extra_function
function
)
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)
...
@@ -41,8 +45,37 @@ int heap_extra(register HP_INFO *info, enum ha_extra_function function)
case
HA_EXTRA_READCHECK
:
case
HA_EXTRA_READCHECK
:
info
->
opt_flag
|=
READ_CHECK_USED
;
info
->
opt_flag
|=
READ_CHECK_USED
;
break
;
break
;
case
HA_EXTRA_CHANGE_KEY_TO_UNIQUE
:
case
HA_EXTRA_CHANGE_KEY_TO_DUP
:
heap_extra_keyflag
(
info
,
function
);
break
;
default:
default:
break
;
break
;
}
}
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
/* heap_extra */
}
/* 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 @
7216c3b2
...
@@ -141,7 +141,12 @@ enum ha_extra_function {
...
@@ -141,7 +141,12 @@ enum ha_extra_function {
HA_EXTRA_RETRIEVE_PRIMARY_KEY
,
HA_EXTRA_RETRIEVE_PRIMARY_KEY
,
HA_EXTRA_PREPARE_FOR_DELETE
,
HA_EXTRA_PREPARE_FOR_DELETE
,
HA_EXTRA_PREPARE_FOR_UPDATE
,
/* Remove read cache if problems */
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() */
/* The following is parameter to ha_panic() */
...
...
myisam/mi_extra.c
View file @
7216c3b2
...
@@ -19,6 +19,9 @@
...
@@ -19,6 +19,9 @@
#include <sys/mman.h>
#include <sys/mman.h>
#endif
#endif
static
void
mi_extra_keyflag
(
MI_INFO
*
info
,
enum
ha_extra_function
function
);
/*
/*
Set options and buffers to optimize table handling
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)
...
@@ -355,6 +358,10 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
case
HA_EXTRA_PRELOAD_BUFFER_SIZE
:
case
HA_EXTRA_PRELOAD_BUFFER_SIZE
:
info
->
preload_buff_size
=
*
((
ulong
*
)
extra_arg
);
info
->
preload_buff_size
=
*
((
ulong
*
)
extra_arg
);
break
;
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_KEY_CACHE
:
case
HA_EXTRA_NO_KEY_CACHE
:
case
HA_EXTRA_NO_KEY_CACHE
:
default:
default:
...
@@ -367,3 +374,27 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
...
@@ -367,3 +374,27 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
}
}
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
/* mi_extra */
}
/* 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