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
96e4dd07
Commit
96e4dd07
authored
Nov 01, 2007
by
kostja@bodhi.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into bodhi.(none):/opt/local/work/mysql-5.1-net_end
parents
f0bfbe0e
7e119ec0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
6 deletions
+42
-6
sql/unireg.cc
sql/unireg.cc
+42
-6
No files found.
sql/unireg.cc
View file @
96e4dd07
...
...
@@ -47,6 +47,35 @@ static bool make_empty_rec(THD *thd, int file, enum legacy_db_type table_type,
uint
reclength
,
ulong
data_offset
,
handler
*
handler
);
/**
An interceptor to hijack ER_TOO_MANY_FIELDS error from
pack_screens and retry again without UNIREG screens.
XXX: what is a UNIREG screen?
*/
struct
Pack_header_error_handler
:
public
Internal_error_handler
{
virtual
bool
handle_error
(
uint
sql_errno
,
const
char
*
message
,
MYSQL_ERROR
::
enum_warning_level
level
,
THD
*
thd
);
bool
is_handled
;
Pack_header_error_handler
()
:
is_handled
(
FALSE
)
{}
};
bool
Pack_header_error_handler
::
handle_error
(
uint
sql_errno
,
const
char
*
/* message */
,
MYSQL_ERROR
::
enum_warning_level
/* level */
,
THD
*
/* thd */
)
{
is_handled
=
(
sql_errno
==
ER_TOO_MANY_FIELDS
);
return
is_handled
;
}
/*
Create a frm (table definition) file
...
...
@@ -86,6 +115,8 @@ bool mysql_create_frm(THD *thd, const char *file_name,
#ifdef WITH_PARTITION_STORAGE_ENGINE
partition_info
*
part_info
=
thd
->
work_part_info
;
#endif
Pack_header_error_handler
pack_header_error_handler
;
int
error
;
DBUG_ENTER
(
"mysql_create_frm"
);
DBUG_ASSERT
(
*
fn_rext
((
char
*
)
file_name
));
// Check .frm extension
...
...
@@ -99,17 +130,22 @@ bool mysql_create_frm(THD *thd, const char *file_name,
create_info
->
null_bits
++
;
data_offset
=
(
create_info
->
null_bits
+
7
)
/
8
;
if
(
pack_header
(
forminfo
,
ha_legacy_type
(
create_info
->
db_type
),
create_fields
,
info_length
,
screens
,
create_info
->
table_options
,
data_offset
,
db_file
))
thd
->
push_internal_handler
(
&
pack_header_error_handler
);
error
=
pack_header
(
forminfo
,
ha_legacy_type
(
create_info
->
db_type
),
create_fields
,
info_length
,
screens
,
create_info
->
table_options
,
data_offset
,
db_file
);
thd
->
pop_internal_handler
();
if
(
error
)
{
my_free
(
screen_buff
,
MYF
(
0
));
if
(
thd
->
net
.
last_errno
!=
ER_TOO_MANY_FIELDS
)
if
(
!
pack_header_error_handler
.
is_handled
)
DBUG_RETURN
(
1
);
// Try again without UNIREG screens (to get more columns)
thd
->
net
.
last_error
[
0
]
=
0
;
if
(
!
(
screen_buff
=
pack_screens
(
create_fields
,
&
info_length
,
&
screens
,
1
)))
DBUG_RETURN
(
1
);
if
(
pack_header
(
forminfo
,
ha_legacy_type
(
create_info
->
db_type
),
...
...
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