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
d2e2de1b
Commit
d2e2de1b
authored
Jan 26, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge rurik.mysql.com:/home/igor/mysql-4.1
into rurik.mysql.com:/home/igor/dev/mysql-4.1-0
parents
235edc21
3c3ca269
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
106 additions
and
22 deletions
+106
-22
BUILD/SETUP.sh
BUILD/SETUP.sh
+6
-2
BUILD/compile-pentium64-debug
BUILD/compile-pentium64-debug
+1
-1
configure.in
configure.in
+3
-3
innobase/fil/fil0fil.c
innobase/fil/fil0fil.c
+3
-3
innobase/include/univ.i
innobase/include/univ.i
+4
-2
mysql-test/r/ndb_index_unique.result
mysql-test/r/ndb_index_unique.result
+14
-0
mysql-test/t/ndb_index_unique.test
mysql-test/t/ndb_index_unique.test
+21
-0
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+50
-9
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+1
-0
sql/item_create.cc
sql/item_create.cc
+3
-2
No files found.
BUILD/SETUP.sh
100644 → 100755
View file @
d2e2de1b
...
...
@@ -25,7 +25,10 @@ Any other options will be passed directly to configure.
Note: this script is intended for internal use by MySQL developers.
EOF
--with-debug
=
full
)
full_debug
=
"=full"
;
shift
;;
*
)
break
;;
*
)
echo
"Unknown option '
$1
'"
exit
1
break
;;
esac
done
...
...
@@ -62,6 +65,7 @@ fast_cflags="-O3 -fno-omit-frame-pointer"
reckless_cflags
=
"-O3 -fomit-frame-pointer "
debug_cflags
=
"-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX"
debug_extra_cflags
=
"-O1 -Wuninitialized"
base_cxxflags
=
"-felide-constructors -fno-exceptions -fno-rtti"
amd64_cxxflags
=
"-DBIG_TABLES"
...
...
@@ -80,7 +84,7 @@ local_infile_configs="--enable-local-infile"
debug_configs
=
"--with-debug
$full_debug
"
if
[
-z
"
$full_debug
"
]
then
debug_cflags
=
"
$debug_cflags
-O1 -Wuninitialized
"
debug_cflags
=
"
$debug_cflags
$debug_extra_cflags
"
fi
if
gmake
--version
>
/dev/null 2>&1
...
...
BUILD/compile-pentium64-debug
View file @
d2e2de1b
#! /bin/sh
path
=
`
dirname
$0
`
.
"
$path
/SETUP.sh"
.
"
$path
/SETUP.sh"
$@
--with-debug
=
full
extra_flags
=
"
$pentium64_cflags
$debug_cflags
"
c_warnings
=
"
$c_warnings
$debug_extra_warnings
"
...
...
configure.in
View file @
d2e2de1b
...
...
@@ -1681,12 +1681,12 @@ if test "$with_debug" = "yes"
then
# Medium debug.
CFLAGS="
$DEBUG_CFLAGS
$DEBUG_OPTIMIZE_CC
-DDBUG_ON
-DSAFE_MUTEX
$CFLAGS
"
CXXFLAGS="
$DEBUG_CXXFLAGS
$DEBUG_OPTIMIZE_CXX
-DSAFE_MUTEX
$CXXFLAGS
"
CXXFLAGS="
$DEBUG_CXXFLAGS
$DEBUG_OPTIMIZE_CXX
-D
DBUG_ON
-D
SAFE_MUTEX
$CXXFLAGS
"
elif test "
$with_debug
" = "
full
"
then
# Full debug. Very slow in some cases
CFLAGS="
$DEBUG_CFLAGS
-DDBUG_ON
-DSAFE_MUTEX
-DSAFEMALLOC
$CFLAGS
"
CXXFLAGS="
$DEBUG_CXXFLAGS
-D
SAFE_MUTEX
-DSAFEMALLOC
$CXXFLAGS
"
CFLAGS="
$DEBUG_CFLAGS
-DDBUG_ON
-DSAFE_MUTEX
-DSAFEMALLOC
-DUNIV_DEBUG
$CFLAGS
"
CXXFLAGS="
$DEBUG_CXXFLAGS
-D
DBUG_ON
-DSAFE_MUTEX
-DSAFEMALLOC
-DUNIV_DEBUG
$CXXFLAGS
"
else
# Optimized version. No debug
CFLAGS="
$OPTIMIZE_CFLAGS
-DDBUG_OFF
$CFLAGS
"
...
...
innobase/fil/fil0fil.c
View file @
d2e2de1b
...
...
@@ -685,9 +685,9 @@ fil_try_to_close_file_in_LRU(
fputs
(
"InnoDB: cannot close file "
,
stderr
);
ut_print_filename
(
stderr
,
node
->
name
);
fprintf
(
stderr
,
", because mod_count %l
ld != fl_count %l
ld
\n
"
,
node
->
modification_counter
,
node
->
flush_counter
);
", because mod_count %l
d != fl_count %
ld
\n
"
,
(
ulong
)
node
->
modification_counter
,
(
ulong
)
node
->
flush_counter
);
}
node
=
UT_LIST_GET_PREV
(
LRU
,
node
);
...
...
innobase/include/univ.i
View file @
d2e2de1b
...
...
@@ -81,9 +81,11 @@ memory is read outside the allocated blocks. */
/* Make a non-inline debug version */
#
ifdef
DBUG_ON
#
define
UNIV_DEBUG
#
define
UNIV_DEBUG
#
endif
/* DBUG_ON */
/*
#define UNIV_DEBUG
#define UNIV_MEM_DEBUG
#define UNIV_IBUF_DEBUG
#define UNIV_SYNC_DEBUG
...
...
mysql-test/r/ndb_index_unique.result
View file @
d2e2de1b
...
...
@@ -612,3 +612,17 @@ a b c
3 NULL NULL
4 4 NULL
drop table t1, t8;
create table t1(
id integer not null auto_increment,
month integer not null,
year integer not null,
code varchar( 2) not null,
primary key ( id),
unique idx_t1( month, code, year)
) engine=ndb;
INSERT INTO t1 (month, year, code) VALUES (4,2004,'12');
INSERT INTO t1 (month, year, code) VALUES (5,2004,'12');
select * from t1 where code = '12' and month = 4 and year = 2004 ;
id month year code
1 4 2004 12
drop table t1;
mysql-test/t/ndb_index_unique.test
View file @
d2e2de1b
...
...
@@ -286,3 +286,24 @@ select * from t8 order by a;
select
*
from
t1
order
by
a
;
drop
table
t1
,
t8
;
###############################
# Bug 8101
#
# Unique index not specified in the same order as in table
#
create
table
t1
(
id
integer
not
null
auto_increment
,
month
integer
not
null
,
year
integer
not
null
,
code
varchar
(
2
)
not
null
,
primary
key
(
id
),
unique
idx_t1
(
month
,
code
,
year
)
)
engine
=
ndb
;
INSERT
INTO
t1
(
month
,
year
,
code
)
VALUES
(
4
,
2004
,
'12'
);
INSERT
INTO
t1
(
month
,
year
,
code
)
VALUES
(
5
,
2004
,
'12'
);
select
*
from
t1
where
code
=
'12'
and
month
=
4
and
year
=
2004
;
drop
table
t1
;
sql/ha_ndbcluster.cc
View file @
d2e2de1b
...
...
@@ -765,6 +765,42 @@ int ha_ndbcluster::get_metadata(const char *path)
DBUG_RETURN
(
build_index_list
(
table
,
ILBP_OPEN
));
}
static
int
fix_unique_index_attr_order
(
NDB_INDEX_DATA
&
data
,
const
NDBINDEX
*
index
,
KEY
*
key_info
)
{
DBUG_ENTER
(
"fix_unique_index_attr_order"
);
unsigned
sz
=
index
->
getNoOfIndexColumns
();
if
(
data
.
unique_index_attrid_map
)
my_free
((
char
*
)
data
.
unique_index_attrid_map
,
MYF
(
0
));
data
.
unique_index_attrid_map
=
(
unsigned
char
*
)
my_malloc
(
sz
,
MYF
(
MY_WME
));
KEY_PART_INFO
*
key_part
=
key_info
->
key_part
;
KEY_PART_INFO
*
end
=
key_part
+
key_info
->
key_parts
;
DBUG_ASSERT
(
key_info
->
key_parts
==
sz
);
for
(
unsigned
i
=
0
;
key_part
!=
end
;
key_part
++
,
i
++
)
{
const
char
*
field_name
=
key_part
->
field
->
field_name
;
unsigned
name_sz
=
strlen
(
field_name
);
if
(
name_sz
>=
NDB_MAX_ATTR_NAME_SIZE
)
name_sz
=
NDB_MAX_ATTR_NAME_SIZE
-
1
;
#ifndef DBUG_OFF
data
.
unique_index_attrid_map
[
i
]
=
255
;
#endif
for
(
unsigned
j
=
0
;
j
<
sz
;
j
++
)
{
const
NdbDictionary
::
Column
*
c
=
index
->
getColumn
(
j
);
if
(
strncmp
(
field_name
,
c
->
getName
(),
name_sz
)
==
0
)
{
data
.
unique_index_attrid_map
[
i
]
=
j
;
break
;
}
}
DBUG_ASSERT
(
data
.
unique_index_attrid_map
[
i
]
!=
255
);
}
DBUG_RETURN
(
0
);
}
int
ha_ndbcluster
::
build_index_list
(
TABLE
*
tab
,
enum
ILBP
phase
)
{
...
...
@@ -839,6 +875,7 @@ int ha_ndbcluster::build_index_list(TABLE *tab, enum ILBP phase)
const
NDBINDEX
*
index
=
dict
->
getIndex
(
unique_index_name
,
m_tabname
);
if
(
!
index
)
DBUG_RETURN
(
1
);
m_index
[
i
].
unique_index
=
(
void
*
)
index
;
error
=
fix_unique_index_attr_order
(
m_index
[
i
],
index
,
key_info
);
}
}
...
...
@@ -897,6 +934,11 @@ void ha_ndbcluster::release_metadata()
{
m_index
[
i
].
unique_index
=
NULL
;
m_index
[
i
].
index
=
NULL
;
if
(
m_index
[
i
].
unique_index_attrid_map
)
{
my_free
((
char
*
)
m_index
[
i
].
unique_index_attrid_map
,
MYF
(
0
));
m_index
[
i
].
unique_index_attrid_map
=
NULL
;
}
}
DBUG_VOID_RETURN
;
...
...
@@ -1209,7 +1251,8 @@ int ha_ndbcluster::unique_index_read(const byte *key,
for
(
i
=
0
;
key_part
!=
end
;
key_part
++
,
i
++
)
{
if
(
set_ndb_key
(
op
,
key_part
->
field
,
i
,
if
(
set_ndb_key
(
op
,
key_part
->
field
,
m_index
[
active_index
].
unique_index_attrid_map
[
i
],
key_part
->
null_bit
?
key_ptr
+
1
:
key_ptr
))
ERR_RETURN
(
trans
->
getNdbError
());
key_ptr
+=
key_part
->
store_length
;
...
...
@@ -1476,10 +1519,7 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op,
// Set bound if not cancelled via type -1
if
(
p
.
bound_type
!=
-
1
)
{
char
truncated_field_name
[
NDB_MAX_ATTR_NAME_SIZE
];
strnmov
(
truncated_field_name
,
field
->
field_name
,
sizeof
(
truncated_field_name
));
truncated_field_name
[
sizeof
(
truncated_field_name
)
-
1
]
=
'\0'
;
if
(
op
->
setBound
(
truncated_field_name
,
p
.
bound_type
,
p
.
bound_ptr
))
if
(
op
->
setBound
(
i
,
p
.
bound_type
,
p
.
bound_ptr
))
ERR_RETURN
(
op
->
getNdbError
());
}
}
...
...
@@ -3842,6 +3882,7 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg):
m_index
[
i
].
type
=
UNDEFINED_INDEX
;
m_index
[
i
].
unique_index
=
NULL
;
m_index
[
i
].
index
=
NULL
;
m_index
[
i
].
unique_index_attrid_map
=
NULL
;
}
DBUG_VOID_RETURN
;
...
...
sql/ha_ndbcluster.h
View file @
d2e2de1b
...
...
@@ -52,6 +52,7 @@ typedef struct ndb_index_data {
NDB_INDEX_TYPE
type
;
void
*
index
;
void
*
unique_index
;
unsigned
char
*
unique_index_attrid_map
;
}
NDB_INDEX_DATA
;
typedef
struct
st_ndbcluster_share
{
...
...
sql/item_create.cc
View file @
d2e2de1b
...
...
@@ -377,13 +377,14 @@ Item *create_func_space(Item *a)
{
uint
dummy_errors
;
sp
=
new
Item_string
(
""
,
0
,
cs
);
if
(
sp
)
sp
->
str_value
.
copy
(
" "
,
1
,
&
my_charset_latin1
,
cs
,
&
dummy_errors
);
}
else
{
sp
=
new
Item_string
(
" "
,
1
,
cs
);
}
return
new
Item_func_repeat
(
sp
,
a
)
;
return
sp
?
new
Item_func_repeat
(
sp
,
a
)
:
0
;
}
Item
*
create_func_soundex
(
Item
*
a
)
...
...
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