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
ec3e6cc8
Commit
ec3e6cc8
authored
Oct 13, 2014
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.0-connect -> 10.0
parents
911ed937
b10fa87b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
24 deletions
+40
-24
storage/connect/ha_connect.cc
storage/connect/ha_connect.cc
+3
-0
storage/connect/plgdbutl.cpp
storage/connect/plgdbutl.cpp
+4
-2
storage/connect/tabodbc.cpp
storage/connect/tabodbc.cpp
+2
-1
storage/connect/value.cpp
storage/connect/value.cpp
+30
-21
storage/connect/value.h
storage/connect/value.h
+1
-0
No files found.
storage/connect/ha_connect.cc
View file @
ec3e6cc8
...
...
@@ -960,6 +960,8 @@ bool ha_connect::GetBooleanOption(char *opname, bool bdef)
opval
=
options
->
readonly
;
else
if
(
!
stricmp
(
opname
,
"SepIndex"
))
opval
=
options
->
sepindex
;
else
if
(
!
stricmp
(
opname
,
"Header"
))
opval
=
(
options
->
header
!=
0
);
// Is Boolean for some table types
else
if
(
options
->
oplist
)
if
((
pv
=
GetListOption
(
xp
->
g
,
opname
,
options
->
oplist
)))
opval
=
(
!*
pv
||
*
pv
==
'y'
||
*
pv
==
'Y'
||
atoi
(
pv
)
!=
0
);
...
...
@@ -1838,6 +1840,7 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *buf)
}
// endswitch type
((
DTVAL
*
)
sdvalin
)
->
SetFormat
(
g
,
fmt
,
strlen
(
fmt
));
sdvalin
->
SetNullable
(
colp
->
IsNullable
());
fp
->
val_str
(
&
attribute
);
sdvalin
->
SetValue_psz
(
attribute
.
c_ptr_safe
());
value
->
SetValue_pval
(
sdvalin
);
...
...
storage/connect/plgdbutl.cpp
View file @
ec3e6cc8
...
...
@@ -730,6 +730,7 @@ int ExtractDate(char *dts, PDTP pdp, int defy, int val[6])
char
*
fmt
,
c
,
d
,
e
,
W
[
8
][
12
];
int
i
,
k
,
m
,
numval
;
int
n
,
y
=
30
;
bool
b
=
true
;
// true for null dates
if
(
pdp
)
fmt
=
pdp
->
InFmt
;
...
...
@@ -763,7 +764,8 @@ int ExtractDate(char *dts, PDTP pdp, int defy, int val[6])
m
=
pdp
->
Num
;
for
(
i
=
0
;
i
<
m
;
i
++
)
{
n
=
*
(
int
*
)
W
[
i
];
if
((
n
=
*
(
int
*
)
W
[
i
]))
b
=
false
;
switch
(
k
=
pdp
->
Index
[
i
])
{
case
0
:
...
...
@@ -822,7 +824,7 @@ int ExtractDate(char *dts, PDTP pdp, int defy, int val[6])
htrc
(
"numval=%d val=(%d,%d,%d,%d,%d,%d)
\n
"
,
numval
,
val
[
0
],
val
[
1
],
val
[
2
],
val
[
3
],
val
[
4
],
val
[
5
]);
return
numval
;
return
(
b
)
?
0
:
numval
;
}
// end of ExtractDate
/***********************************************************************/
...
...
storage/connect/tabodbc.cpp
View file @
ec3e6cc8
...
...
@@ -1075,8 +1075,9 @@ void ODBCCOL::ReadColumn(PGLOBAL g)
}
// endif Bufp
if
(
Buf_Type
==
TYPE_DATE
)
{
struct
tm
dbtime
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}
;
struct
tm
dbtime
;
memset
(
&
dbtime
,
0
,
sizeof
(
tm
));
dbtime
.
tm_sec
=
(
int
)
Sqlbuf
->
second
;
dbtime
.
tm_min
=
(
int
)
Sqlbuf
->
minute
;
dbtime
.
tm_hour
=
(
int
)
Sqlbuf
->
hour
;
...
...
storage/connect/value.cpp
View file @
ec3e6cc8
...
...
@@ -2428,9 +2428,11 @@ bool DTVAL::SetValue_char(char *p, int n)
if
(
trace
>
1
)
htrc
(
" setting date: '%s' -> %d
\n
"
,
Sdate
,
Tval
);
Null
=
false
;
}
else
Null
=
(
Nullable
&&
ndv
==
0
)
;
}
else
{
rc
=
TYPVAL
<
int
>::
SetValue_char
(
p
,
n
);
Null
=
(
Nullable
&&
Tval
==
0
);
}
// endif Pdtp
return
rc
;
}
// end of SetValue
...
...
@@ -2453,9 +2455,11 @@ void DTVAL::SetValue_psz(PSZ p)
if
(
trace
>
1
)
htrc
(
" setting date: '%s' -> %d
\n
"
,
Sdate
,
Tval
);
Null
=
false
;
}
else
Null
=
(
Nullable
&&
ndv
==
0
)
;
}
else
{
TYPVAL
<
int
>::
SetValue_psz
(
p
);
Null
=
(
Nullable
&&
Tval
==
0
);
}
// endif Pdtp
}
// end of SetValue
...
...
@@ -2496,7 +2500,7 @@ char *DTVAL::GetCharString(char *p)
}
else
sprintf
(
p
,
"%d"
,
Tval
);
Null
=
false
;
//Null = false; ??????????????
return
p
;
}
// end of GetCharString
...
...
@@ -2507,24 +2511,29 @@ char *DTVAL::ShowValue(char *buf, int len)
{
if
(
Pdtp
)
{
char
*
p
;
size_t
m
,
n
=
0
;
struct
tm
tm
,
*
ptm
=
GetGmTime
(
&
tm
);
if
(
Len
<
len
)
{
p
=
buf
;
m
=
len
;
}
else
{
p
=
Sdate
;
m
=
Len
+
1
;
}
// endif Len
if
(
ptm
)
n
=
strftime
(
p
,
m
,
Pdtp
->
OutFmt
,
ptm
);
if
(
!
Null
)
{
size_t
m
,
n
=
0
;
struct
tm
tm
,
*
ptm
=
GetGmTime
(
&
tm
);
if
(
Len
<
len
)
{
p
=
buf
;
m
=
len
;
}
else
{
p
=
Sdate
;
m
=
Len
+
1
;
}
// endif Len
if
(
ptm
)
n
=
strftime
(
p
,
m
,
Pdtp
->
OutFmt
,
ptm
);
if
(
!
n
)
{
*
p
=
'\0'
;
strncat
(
p
,
"Error"
,
m
);
}
// endif n
if
(
!
n
)
{
*
p
=
'\0'
;
strncat
(
p
,
"Error"
,
m
);
}
// endif n
}
else
p
=
""
;
// DEFAULT VALUE ???
return
p
;
}
else
...
...
storage/connect/value.h
View file @
ec3e6cc8
...
...
@@ -357,6 +357,7 @@ class DllExport DTVAL : public TYPVAL<int> {
DTVAL
(
PGLOBAL
g
,
double
f
);
// Implementation
virtual
bool
IsZero
(
void
)
{
return
Null
;}
virtual
bool
SetValue_pval
(
PVAL
valp
,
bool
chktype
);
virtual
bool
SetValue_char
(
char
*
p
,
int
n
);
virtual
void
SetValue_psz
(
PSZ
s
);
...
...
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