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
ad41e7ee
Commit
ad41e7ee
authored
Jan 31, 2013
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix incorrect DBF type setting for SORT and BIGINT.
parent
7af8c83d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
16 deletions
+48
-16
storage/connect/engmsg.h
storage/connect/engmsg.h
+1
-1
storage/connect/filamdbf.cpp
storage/connect/filamdbf.cpp
+20
-2
storage/connect/frmsg1.h
storage/connect/frmsg1.h
+1
-1
storage/connect/frmsg2.h
storage/connect/frmsg2.h
+1
-1
storage/connect/tabfix.cpp
storage/connect/tabfix.cpp
+25
-11
No files found.
storage/connect/engmsg.h
View file @
ad41e7ee
...
...
@@ -963,7 +963,7 @@
#define MSG_VALTYPE_NOMATCH "Non matching Value types"
#define MSG_VALUE_ERROR "Column %s: value is null"
#define MSG_VALUE_NOT_ALLOC "Value not allocated for column R%d %s"
#define MSG_VALUE_TOO_BIG "Value %d too big for column %s"
#define MSG_VALUE_TOO_BIG "Value %
ll
d too big for column %s"
#define MSG_VALUE_TOO_LONG "Value %s too long for column %s of length %d"
#define MSG_VAL_ALLOC_ERR "Cannot allocate value node"
#define MSG_VAL_TOO_LONG "Value field %s too long for %s"
...
...
storage/connect/filamdbf.cpp
View file @
ad41e7ee
...
...
@@ -512,6 +512,7 @@ bool DBFFAM::OpenTableFile(PGLOBAL g)
/****************************************************************************/
bool
DBFFAM
::
AllocateBuffer
(
PGLOBAL
g
)
{
char
c
;
int
rc
;
MODE
mode
=
Tdbp
->
GetMode
();
...
...
@@ -570,12 +571,29 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g)
header
->
Reclen
=
(
ushort
)
reclen
;
descp
=
(
DESCRIPTOR
*
)
header
;
// Currently only standard Xbase types are supported
for
(
cdp
=
tdp
->
GetCols
();
cdp
;
cdp
=
cdp
->
GetNext
())
{
descp
++
;
switch
((
c
=
*
GetFormatType
(
cdp
->
GetType
())))
{
case
'S'
:
// Short integer
case
'L'
:
// Large (big) integer
c
=
'N'
;
// Numeric
case
'N'
:
// Numeric (integer)
case
'F'
:
// Float (double)
descp
->
Decimals
=
(
uchar
)
cdp
->
F
.
Prec
;
case
'C'
:
// Char
case
'D'
:
// Date
break
;
default:
// Should never happen
sprintf
(
g
->
Message
,
"Unsupported DBF type %c for column %s"
,
c
,
cdp
->
GetName
());
return
true
;
}
// endswitch c
strncpy
(
descp
->
Name
,
cdp
->
GetName
(),
11
);
descp
->
Type
=
*
GetFormatType
(
cdp
->
GetType
())
;
descp
->
Type
=
c
;
descp
->
Length
=
(
uchar
)
cdp
->
GetLong
();
descp
->
Decimals
=
(
uchar
)
cdp
->
F
.
Prec
;
}
// endfor cdp
*
(
char
*
)(
++
descp
)
=
EOH
;
...
...
storage/connect/frmsg1.h
View file @
ad41e7ee
...
...
@@ -963,7 +963,7 @@
#define MSG_VALTYPE_NOMATCH "Disparité types de valeur"
#define MSG_VALUE_ERROR "Colonne %s: bloc valeur nul"
#define MSG_VALUE_NOT_ALLOC "Valeur non allouée pour la colonne R%d %s"
#define MSG_VALUE_TOO_BIG "Valeur %d trop grande pour la colonne %s"
#define MSG_VALUE_TOO_BIG "Valeur %
ll
d trop grande pour la colonne %s"
#define MSG_VALUE_TOO_LONG "Valeur %s trop longue pour la colonne %s de longueur %d"
#define MSG_VAL_ALLOC_ERR "Allocation impossible du noeud valeur"
#define MSG_VAL_TOO_LONG "Valeur %s trop longue pour le champ %s"
...
...
storage/connect/frmsg2.h
View file @
ad41e7ee
...
...
@@ -963,7 +963,7 @@
#define MSG_VALTYPE_NOMATCH "Disparit‚ types de valeur"
#define MSG_VALUE_ERROR "Colonne %s: bloc valeur nul"
#define MSG_VALUE_NOT_ALLOC "Valeur non allou‚e pour la colonne R%d %s"
#define MSG_VALUE_TOO_BIG "Valeur %d trop grande pour la colonne %s"
#define MSG_VALUE_TOO_BIG "Valeur %
ll
d trop grande pour la colonne %s"
#define MSG_VALUE_TOO_LONG "Valeur %s trop longue pour la colonne %s de longueur %d"
#define MSG_VAL_ALLOC_ERR "Allocation impossible du noeud valeur"
#define MSG_VAL_TOO_LONG "Valeur %s trop longue pour le champ %s"
...
...
storage/connect/tabfix.cpp
View file @
ad41e7ee
...
...
@@ -355,8 +355,10 @@ void BINCOL::ReadColumn(PGLOBAL g)
case
'T'
:
// Tiny integer
Value
->
SetValue
((
int
)
*
p
);
break
;
case
'I'
:
// Integer or
case
'L'
:
// Long Integer
strcpy
(
g
->
Message
,
"Format L is deprecated, use I"
);
longjmp
(
g
->
jumper
[
g
->
jump_level
],
11
);
case
'I'
:
// Integer
Value
->
SetValue
(
*
(
int
*
)
p
);
break
;
case
'F'
:
// Float
...
...
@@ -383,9 +385,9 @@ void BINCOL::ReadColumn(PGLOBAL g)
/***********************************************************************/
void
BINCOL
::
WriteColumn
(
PGLOBAL
g
)
{
char
*
p
,
*
s
;
int
n
;
PTDBFIX
tdbp
=
(
PTDBFIX
)
To_Tdb
;
char
*
p
,
*
s
;
longlong
n
;
PTDBFIX
tdbp
=
(
PTDBFIX
)
To_Tdb
;
if
(
trace
)
{
htrc
(
"BIN WriteColumn: col %s R%d coluse=%.4X status=%.4X"
,
...
...
@@ -419,30 +421,42 @@ void BINCOL::WriteColumn(PGLOBAL g)
break
;
case
'S'
:
// Short integer
n
=
Value
->
Get
I
ntValue
();
n
=
Value
->
Get
Bigi
ntValue
();
if
(
n
>
32767
||
n
<
-
32768
)
{
if
(
n
>
32767
LL
||
n
<
-
32768LL
)
{
sprintf
(
g
->
Message
,
MSG
(
VALUE_TOO_BIG
),
n
,
Name
);
longjmp
(
g
->
jumper
[
g
->
jump_level
],
31
);
}
else
if
(
Status
)
*
(
short
*
)
p
=
(
short
)
n
;
break
;
case
'T'
:
//
Short
integer
n
=
Value
->
Get
I
ntValue
();
case
'T'
:
//
Tiny
integer
n
=
Value
->
Get
Bigi
ntValue
();
if
(
n
>
255
||
n
<
-
256
)
{
if
(
n
>
255
LL
||
n
<
-
256LL
)
{
sprintf
(
g
->
Message
,
MSG
(
VALUE_TOO_BIG
),
n
,
Name
);
longjmp
(
g
->
jumper
[
g
->
jump_level
],
31
);
}
else
if
(
Status
)
*
p
=
(
char
)
n
;
break
;
case
'I'
:
// Integer or
case
'L'
:
// Long Integer
if
(
Status
)
strcpy
(
g
->
Message
,
"Format L is deprecated, use I"
);
longjmp
(
g
->
jumper
[
g
->
jump_level
],
11
);
case
'I'
:
// Integer
n
=
Value
->
GetBigintValue
();
if
(
n
>
INT_MAX
||
n
<
INT_MIN
)
{
sprintf
(
g
->
Message
,
MSG
(
VALUE_TOO_BIG
),
n
,
Name
);
longjmp
(
g
->
jumper
[
g
->
jump_level
],
31
);
}
else
if
(
Status
)
*
(
int
*
)
p
=
Value
->
GetIntValue
();
break
;
case
'B'
:
// Large (big) integer
if
(
Status
)
*
(
longlong
*
)
p
=
(
longlong
)
Value
->
GetBigintValue
();
break
;
case
'F'
:
// Float
case
'R'
:
// Real
...
...
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