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
ae55711e
Commit
ae55711e
authored
Aug 17, 2010
by
Vasil Dimov
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql-5.1-innodb from bk-internal into my local tree
parents
fbfbe2a6
ff8cf2e9
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
71 additions
and
15 deletions
+71
-15
storage/innobase/dict/dict0dict.c
storage/innobase/dict/dict0dict.c
+2
-2
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+29
-6
storage/innobase/include/db0err.h
storage/innobase/include/db0err.h
+6
-0
storage/innodb_plugin/ChangeLog
storage/innodb_plugin/ChangeLog
+12
-0
storage/innodb_plugin/btr/btr0sea.c
storage/innodb_plugin/btr/btr0sea.c
+2
-0
storage/innodb_plugin/ha/ha0ha.c
storage/innodb_plugin/ha/ha0ha.c
+2
-0
storage/innodb_plugin/handler/ha_innodb.cc
storage/innodb_plugin/handler/ha_innodb.cc
+5
-4
storage/innodb_plugin/include/btr0sea.h
storage/innodb_plugin/include/btr0sea.h
+4
-0
storage/innodb_plugin/include/ha0ha.h
storage/innodb_plugin/include/ha0ha.h
+2
-0
storage/innodb_plugin/include/ut0mem.h
storage/innodb_plugin/include/ut0mem.h
+2
-1
storage/innodb_plugin/ut/ut0mem.c
storage/innodb_plugin/ut/ut0mem.c
+5
-2
No files found.
storage/innobase/dict/dict0dict.c
View file @
ae55711e
...
...
@@ -2140,7 +2140,7 @@ dict_foreign_add_to_cache(
mem_heap_free
(
foreign
->
heap
);
}
return
(
DB_
CANNOT_ADD_CONSTRAINT
);
return
(
DB_
FOREIGN_NO_INDEX
);
}
for_in_cache
->
referenced_table
=
ref_table
;
...
...
@@ -2184,7 +2184,7 @@ dict_foreign_add_to_cache(
mem_heap_free
(
foreign
->
heap
);
}
return
(
DB_
CANNOT_ADD_CONSTRAINT
);
return
(
DB_
REFERENCING_NO_INDEX
);
}
for_in_cache
->
foreign_table
=
for_table
;
...
...
storage/innobase/handler/ha_innodb.cc
View file @
ae55711e
...
...
@@ -707,7 +707,9 @@ convert_error_code_to_mysql(
return
(
HA_ERR_ROW_IS_REFERENCED
);
}
else
if
(
error
==
(
int
)
DB_CANNOT_ADD_CONSTRAINT
)
{
}
else
if
(
error
==
(
int
)
DB_CANNOT_ADD_CONSTRAINT
||
error
==
(
int
)
DB_FOREIGN_NO_INDEX
||
error
==
(
int
)
DB_REFERENCING_NO_INDEX
)
{
return
(
HA_ERR_CANNOT_ADD_FOREIGN
);
...
...
@@ -6099,6 +6101,8 @@ ha_innobase::rename_table(
innobase_commit_low
(
trx
);
trx_free_for_mysql
(
trx
);
switch
(
error
)
{
case
DB_DUPLICATE_KEY
:
/* Add a special case to handle the Duplicated Key error
and return DB_ERROR instead.
This is to avoid a possible SIGSEGV error from mysql error
...
...
@@ -6111,10 +6115,28 @@ ha_innobase::rename_table(
the dup key error here is due to an existing table whose name
is the one we are trying to rename to) and return the generic
error code. */
if
(
error
==
(
int
)
DB_DUPLICATE_KEY
)
{
my_error
(
ER_TABLE_EXISTS_ERROR
,
MYF
(
0
),
to
);
error
=
DB_ERROR
;
break
;
case
DB_FOREIGN_NO_INDEX
:
push_warning_printf
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
HA_ERR_CANNOT_ADD_FOREIGN
,
"Alter or rename of table '%s' failed"
" because the new table is a child table"
" in a FK relationship and it does not"
" have an index that contains foreign"
" keys as its prefix columns."
,
norm_to
);
break
;
case
DB_REFERENCING_NO_INDEX
:
push_warning_printf
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
HA_ERR_CANNOT_ADD_FOREIGN
,
"Alter or rename of table '%s' failed"
" because the new table is a parent table"
" in a FK relationship and it does not"
" have an index that contains foreign"
" keys as its prefix columns."
,
norm_to
);
break
;
}
error
=
convert_error_code_to_mysql
(
error
,
NULL
);
...
...
@@ -7814,16 +7836,17 @@ ha_innobase::store_lock(
&&
(
lock_type
==
TL_READ
||
lock_type
==
TL_READ_NO_INSERT
)
&&
(
sql_command
==
SQLCOM_INSERT_SELECT
||
sql_command
==
SQLCOM_UPDATE
||
sql_command
==
SQLCOM_CREATE_TABLE
))
{
||
sql_command
==
SQLCOM_CREATE_TABLE
||
sql_command
==
SQLCOM_SET_OPTION
))
{
/* If we either have innobase_locks_unsafe_for_binlog
option set or this session is using READ COMMITTED
isolation level and isolation level of the transaction
is not set to serializable and MySQL is doing
INSERT INTO...SELECT or UPDATE ... = (SELECT ...) or
CREATE ... SELECT...
without FOR UPDATE or
IN SHARE MODE in select, then we use consistent
read for select. */
CREATE ... SELECT...
or SET ... = (SELECT ...)
without FOR UPDATE or IN SHARE MODE in select,
then we use consistent
read for select. */
prebuilt
->
select_lock_type
=
LOCK_NONE
;
prebuilt
->
stored_select_lock_type
=
LOCK_NONE
;
...
...
storage/innobase/include/db0err.h
View file @
ae55711e
...
...
@@ -73,6 +73,12 @@ Created 5/24/1996 Heikki Tuuri
a later version of the engine. */
#define DB_INTERRUPTED 49
/* the query has been interrupted with
"KILL QUERY N;" */
#define DB_FOREIGN_NO_INDEX 50
/* the child (foreign) table does not
have an index that contains the
foreign keys as its prefix columns */
#define DB_REFERENCING_NO_INDEX 51
/* the parent (referencing) table does
not have an index that contains the
foreign keys as its prefix columns */
/* The following are partial failure codes */
#define DB_FAIL 1000
...
...
storage/innodb_plugin/ChangeLog
View file @
ae55711e
2010-08-03 The InnoDB Team
* include/ut0mem.h, ut/ut0mem.c:
Fix Bug #55627 segv in ut_free pars_lexer_close innobase_shutdown
innodb-use-sys-malloc=0
2010-08-01 The InnoDB Team
* handler/ha_innodb.cc
Fix Bug #55382 Assignment with SELECT expressions takes unexpected
S locks in READ COMMITTED
2010-07-27 The InnoDB Team
* include/mem0pool.h, mem/mem0mem.c, mem/mem0pool.c, srv/srv0start.c:
...
...
storage/innodb_plugin/btr/btr0sea.c
View file @
ae55711e
...
...
@@ -1734,6 +1734,7 @@ btr_search_update_hash_on_insert(
}
}
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
/********************************************************************//**
Validates the search system.
@return TRUE if ok */
...
...
@@ -1897,3 +1898,4 @@ btr_search_validate(void)
return
(
ok
);
}
#endif
/* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */
storage/innodb_plugin/ha/ha0ha.c
View file @
ae55711e
...
...
@@ -354,6 +354,7 @@ ha_remove_all_nodes_to_page(
#endif
}
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
/*************************************************************//**
Validates a given range of the cells in hash table.
@return TRUE if ok */
...
...
@@ -400,6 +401,7 @@ ha_validate(
return
(
ok
);
}
#endif
/* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */
/*************************************************************//**
Prints info of a hash table. */
...
...
storage/innodb_plugin/handler/ha_innodb.cc
View file @
ae55711e
...
...
@@ -9235,7 +9235,8 @@ ha_innobase::store_lock(
&&
(
sql_command
==
SQLCOM_INSERT_SELECT
||
sql_command
==
SQLCOM_REPLACE_SELECT
||
sql_command
==
SQLCOM_UPDATE
||
sql_command
==
SQLCOM_CREATE_TABLE
))
{
||
sql_command
==
SQLCOM_CREATE_TABLE
||
sql_command
==
SQLCOM_SET_OPTION
))
{
/* If we either have innobase_locks_unsafe_for_binlog
option set or this session is using READ COMMITTED
...
...
@@ -9243,9 +9244,9 @@ ha_innobase::store_lock(
is not set to serializable and MySQL is doing
INSERT INTO...SELECT or REPLACE INTO...SELECT
or UPDATE ... = (SELECT ...) or CREATE ...
SELECT...
without FOR UPDATE or IN SHARE
MODE in select, then we use consistent read
for select. */
SELECT...
or SET ... = (SELECT ...) without
FOR UPDATE or IN SHARE MODE in select,
then we use consistent read
for select. */
prebuilt
->
select_lock_type
=
LOCK_NONE
;
prebuilt
->
stored_select_lock_type
=
LOCK_NONE
;
...
...
storage/innodb_plugin/include/btr0sea.h
View file @
ae55711e
...
...
@@ -180,6 +180,7 @@ btr_search_update_hash_on_delete(
btr_cur_t
*
cursor
);
/*!< in: cursor which was positioned on the
record to delete using btr_cur_search_...,
the record is not yet deleted */
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
/********************************************************************//**
Validates the search system.
@return TRUE if ok */
...
...
@@ -187,6 +188,9 @@ UNIV_INTERN
ibool
btr_search_validate
(
void
);
/*======================*/
#else
# define btr_search_validate() TRUE
#endif
/* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */
/** Flag: has the search system been enabled?
Protected by btr_search_latch and btr_search_enabled_mutex. */
...
...
storage/innodb_plugin/include/ha0ha.h
View file @
ae55711e
...
...
@@ -186,6 +186,7 @@ ha_remove_all_nodes_to_page(
hash_table_t
*
table
,
/*!< in: hash table */
ulint
fold
,
/*!< in: fold value */
const
page_t
*
page
);
/*!< in: buffer page */
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
/*************************************************************//**
Validates a given range of the cells in hash table.
@return TRUE if ok */
...
...
@@ -196,6 +197,7 @@ ha_validate(
hash_table_t
*
table
,
/*!< in: hash table */
ulint
start_index
,
/*!< in: start index */
ulint
end_index
);
/*!< in: end index */
#endif
/* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */
/*************************************************************//**
Prints info of a hash table. */
UNIV_INTERN
...
...
storage/innodb_plugin/include/ut0mem.h
View file @
ae55711e
...
...
@@ -113,7 +113,8 @@ ut_test_malloc(
ulint
n
);
/*!< in: try to allocate this many bytes */
#endif
/* !UNIV_HOTBACKUP */
/**********************************************************************//**
Frees a memory block allocated with ut_malloc. */
Frees a memory block allocated with ut_malloc. Freeing a NULL pointer is
a nop. */
UNIV_INTERN
void
ut_free
(
...
...
storage/innodb_plugin/ut/ut0mem.c
View file @
ae55711e
...
...
@@ -290,7 +290,8 @@ ut_test_malloc(
#endif
/* !UNIV_HOTBACKUP */
/**********************************************************************//**
Frees a memory block allocated with ut_malloc. */
Frees a memory block allocated with ut_malloc. Freeing a NULL pointer is
a nop. */
UNIV_INTERN
void
ut_free
(
...
...
@@ -300,7 +301,9 @@ ut_free(
#ifndef UNIV_HOTBACKUP
ut_mem_block_t
*
block
;
if
(
UNIV_LIKELY
(
srv_use_sys_malloc
))
{
if
(
ptr
==
NULL
)
{
return
;
}
else
if
(
UNIV_LIKELY
(
srv_use_sys_malloc
))
{
free
(
ptr
);
return
;
}
...
...
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