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
78260fc1
Commit
78260fc1
authored
Dec 22, 2004
by
bar@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugs#7278: Don't open a table if it contains columns with non-supported charsets
parent
c104fe59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
8 deletions
+29
-8
sql/table.cc
sql/table.cc
+29
-8
No files found.
sql/table.cc
View file @
78260fc1
...
...
@@ -24,7 +24,8 @@
/* Functions defined in this file */
static
void
frm_error
(
int
error
,
TABLE
*
form
,
const
char
*
name
,
int
errortype
);
static
void
frm_error
(
int
error
,
TABLE
*
form
,
const
char
*
name
,
int
errortype
,
int
errarg
);
static
void
fix_type_pointers
(
const
char
***
array
,
TYPELIB
*
point_to_type
,
uint
types
,
char
**
names
);
static
uint
find_field
(
TABLE
*
form
,
uint
start
,
uint
length
);
...
...
@@ -57,6 +58,7 @@ static byte* get_field_name(Field **buff,uint *length,
2 Error (see frm_error)
3 Wrong data in .frm file
4 Error (see frm_error)
5 Error (see frm_error: charset unavailable)
*/
int
openfrm
(
const
char
*
name
,
const
char
*
alias
,
uint
db_stat
,
uint
prgflag
,
...
...
@@ -64,7 +66,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
{
reg1
uint
i
;
reg2
uchar
*
strpos
;
int
j
,
error
;
int
j
,
error
,
errarg
=
0
;
uint
rec_buff_length
,
n_length
,
int_length
,
records
,
key_parts
,
keys
,
interval_count
,
interval_parts
,
read_length
,
db_create_options
;
uint
key_info_length
,
com_length
;
...
...
@@ -436,10 +438,14 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
}
else
{
if
(
!
strpos
[
14
])
charset
=
&
my_charset_bin
;
else
if
(
!
(
charset
=
get_charset
((
uint
)
strpos
[
14
],
MYF
(
0
))))
charset
=
outparam
->
table_charset
;
if
(
!
strpos
[
14
])
charset
=
&
my_charset_bin
;
else
if
(
!
(
charset
=
get_charset
((
uint
)
strpos
[
14
],
MYF
(
0
))))
{
error
=
5
;
// Unknown or unavailable charset
errarg
=
(
int
)
strpos
[
14
];
goto
err_not_open
;
}
}
if
(
!
comment_length
)
{
...
...
@@ -781,7 +787,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
err_end:
/* Here when no file */
delete
crypted
;
*
root_ptr
=
old_root
;
frm_error
(
error
,
outparam
,
name
,
ME_ERROR
+
ME_WAITTANG
);
frm_error
(
error
,
outparam
,
name
,
ME_ERROR
+
ME_WAITTANG
,
errarg
);
delete
outparam
->
file
;
outparam
->
file
=
0
;
// For easyer errorchecking
outparam
->
db_stat
=
0
;
...
...
@@ -966,7 +972,8 @@ ulong make_new_entry(File file, uchar *fileinfo, TYPELIB *formnames,
/* error message when opening a form file */
static
void
frm_error
(
int
error
,
TABLE
*
form
,
const
char
*
name
,
myf
errortype
)
static
void
frm_error
(
int
error
,
TABLE
*
form
,
const
char
*
name
,
myf
errortype
,
int
errarg
)
{
int
err_no
;
char
buff
[
FN_REFLEN
];
...
...
@@ -997,6 +1004,20 @@ static void frm_error(int error, TABLE *form, const char *name, myf errortype)
fn_format
(
buff
,
form
->
real_name
,
form_dev
,
datext
,
2
),
my_errno
);
break
;
}
case
5
:
{
const
char
*
csname
=
get_charset_name
((
uint
)
errarg
);
char
tmp
[
10
];
if
(
!
csname
||
csname
[
0
]
==
'?'
)
{
my_snprintf
(
tmp
,
sizeof
(
tmp
),
"#%d"
,
errarg
);
csname
=
tmp
;
}
my_printf_error
(
ER_UNKNOWN_COLLATION
,
"Unknown collation '%s' in table '%-.64s' definition"
,
MYF
(
0
),
csname
,
form
->
real_name
);
break
;
}
default:
/* Better wrong error than none */
case
4
:
my_error
(
ER_NOT_FORM_FILE
,
errortype
,
...
...
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