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
26e2dd39
Commit
26e2dd39
authored
Aug 07, 2018
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'connect/10.2' into 10.2
parents
4ddcb4eb
9644415f
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
136 additions
and
141 deletions
+136
-141
storage/connect/filamtxt.cpp
storage/connect/filamtxt.cpp
+2
-2
storage/connect/filamvct.cpp
storage/connect/filamvct.cpp
+3
-3
storage/connect/ha_connect.cc
storage/connect/ha_connect.cc
+8
-16
storage/connect/javaconn.cpp
storage/connect/javaconn.cpp
+13
-5
storage/connect/javaconn.h
storage/connect/javaconn.h
+1
-0
storage/connect/jdbconn.cpp
storage/connect/jdbconn.cpp
+13
-21
storage/connect/jmgoconn.cpp
storage/connect/jmgoconn.cpp
+3
-3
storage/connect/jsonudf.cpp
storage/connect/jsonudf.cpp
+1
-1
storage/connect/mysql-test/connect/r/jdbc.result
storage/connect/mysql-test/connect/r/jdbc.result
+1
-2
storage/connect/tabjmg.cpp
storage/connect/tabjmg.cpp
+7
-4
storage/connect/tabpivot.cpp
storage/connect/tabpivot.cpp
+83
-83
storage/connect/tabutil.cpp
storage/connect/tabutil.cpp
+1
-1
No files found.
storage/connect/filamtxt.cpp
View file @
26e2dd39
...
...
@@ -1173,11 +1173,11 @@ int DOSFAM::RenameTempFile(PGLOBAL g)
remove
(
filetemp
);
// May still be there from previous error
if
(
rename
(
filename
,
filetemp
))
{
// Save file for security
s
printf
(
g
->
Message
,
MSG
(
RENAME_ERROR
),
s
nprintf
(
g
->
Message
,
MAX_STR
,
MSG
(
RENAME_ERROR
),
filename
,
filetemp
,
strerror
(
errno
));
throw
51
;
}
else
if
(
rename
(
tempname
,
filename
))
{
s
printf
(
g
->
Message
,
MSG
(
RENAME_ERROR
),
s
nprintf
(
g
->
Message
,
MAX_STR
,
MSG
(
RENAME_ERROR
),
tempname
,
filename
,
strerror
(
errno
));
rc
=
rename
(
filetemp
,
filename
);
// Restore saved file
throw
52
;
...
...
storage/connect/filamvct.cpp
View file @
26e2dd39
...
...
@@ -348,7 +348,7 @@ int VCTFAM::Cardinality(PGLOBAL g)
}
// endif split
return
(
Block
)
?
((
Block
-
1
)
*
Nrec
+
Last
)
:
0
;
return
(
Block
)
?
((
Block
-
1
)
*
Nrec
+
Last
)
:
0
;
}
// end of Cardinality
/***********************************************************************/
...
...
@@ -2453,11 +2453,11 @@ int VECFAM::RenameTempFile(PGLOBAL g)
remove
(
filetemp
);
// May still be there from previous error
if
(
rename
(
filename
,
filetemp
))
{
// Save file for security
s
printf
(
g
->
Message
,
MSG
(
RENAME_ERROR
),
s
nprintf
(
g
->
Message
,
MAX_STR
,
MSG
(
RENAME_ERROR
),
filename
,
filetemp
,
strerror
(
errno
));
rc
=
RC_FX
;
}
else
if
(
rename
(
tempname
,
filename
))
{
s
printf
(
g
->
Message
,
MSG
(
RENAME_ERROR
),
s
nprintf
(
g
->
Message
,
MAX_STR
,
MSG
(
RENAME_ERROR
),
tempname
,
filename
,
strerror
(
errno
));
rc
=
rename
(
filetemp
,
filename
);
// Restore saved file
rc
=
RC_FX
;
...
...
storage/connect/ha_connect.cc
View file @
26e2dd39
...
...
@@ -170,7 +170,7 @@
#define JSONMAX 10 // JSON Default max grp size
extern
"C"
{
char
version
[]
=
"Version 1.06.0007
March 11
, 2018"
;
char
version
[]
=
"Version 1.06.0007
August 06
, 2018"
;
#if defined(__WIN__)
char
compver
[]
=
"Version 1.06.0007 "
__DATE__
" "
__TIME__
;
char
slash
=
'\\'
;
...
...
@@ -3303,23 +3303,15 @@ bool ha_connect::get_error_message(int error, String* buf)
{
DBUG_ENTER
(
"ha_connect::get_error_message"
);
if
(
xp
&&
xp
->
g
)
{
PGLOBAL
g
=
xp
->
g
;
char
msg
[
3072
];
// MAX_STR * 3
uint
dummy_errors
;
uint32
len
=
copy_and_convert
(
msg
,
strlen
(
g
->
Message
)
*
3
,
system_charset_info
,
g
->
Message
,
strlen
(
g
->
Message
),
&
my_charset_latin1
,
&
dummy_errors
);
if
(
xp
&&
xp
->
g
)
{
PGLOBAL
g
=
xp
->
g
;
if
(
trace
(
1
))
htrc
(
"GEM(%d): len=%u %s
\n
"
,
error
,
len
,
g
->
Message
);
if
(
trace
(
1
))
htrc
(
"GEM(%d): %s
\n
"
,
error
,
g
->
Message
);
msg
[
len
]
=
'\0'
;
buf
->
copy
(
msg
,
(
uint
)
strlen
(
msg
),
system_charset_info
);
}
else
buf
->
copy
(
"Cannot retrieve msg"
,
19
,
system_charset_info
);
buf
->
append
(
g
->
Message
);
}
else
buf
->
append
(
"Cannot retrieve error message"
);
DBUG_RETURN
(
false
);
}
// end of get_error_message
...
...
storage/connect/javaconn.cpp
View file @
26e2dd39
...
...
@@ -138,6 +138,16 @@ JAVAConn::JAVAConn(PGLOBAL g, PCSZ wrapper)
// EndCom();
// } // end of ~JAVAConn
char
*
JAVAConn
::
GetUTFString
(
jstring
s
)
{
char
*
str
;
const
char
*
utf
=
env
->
GetStringUTFChars
(
s
,
nullptr
);
str
=
PlugDup
(
m_G
,
utf
);
env
->
ReleaseStringUTFChars
(
s
,
utf
);
env
->
DeleteLocalRef
(
s
);
return
str
;
}
// end of GetUTFString
/***********************************************************************/
/* Screen for errors. */
...
...
@@ -152,17 +162,15 @@ bool JAVAConn::Check(jint rc)
"toString"
,
"()Ljava/lang/String;"
);
if
(
exc
!=
nullptr
&&
tid
!=
nullptr
)
{
jstring
s
=
(
jstring
)
env
->
CallObjectMethod
(
exc
,
tid
);
const
char
*
utf
=
env
->
GetStringUTFChars
(
s
,
(
jboolean
)
false
);
env
->
DeleteLocalRef
(
s
);
Msg
=
PlugDup
(
m_G
,
utf
);
s
=
(
jstring
)
env
->
CallObjectMethod
(
exc
,
tid
);
Msg
=
GetUTFString
(
s
);
}
else
Msg
=
"Exception occured"
;
env
->
ExceptionClear
();
}
else
if
(
rc
<
0
)
{
s
=
(
jstring
)
env
->
CallObjectMethod
(
job
,
errid
);
Msg
=
(
char
*
)
env
->
GetStringUTFChars
(
s
,
(
jboolean
)
false
);
Msg
=
GetUTFString
(
s
);
}
else
Msg
=
NULL
;
...
...
storage/connect/javaconn.h
View file @
26e2dd39
...
...
@@ -90,6 +90,7 @@ class DllExport JAVAConn : public BLOCK {
// Java operations
protected:
char
*
GetUTFString
(
jstring
s
);
bool
gmID
(
PGLOBAL
g
,
jmethodID
&
mid
,
const
char
*
name
,
const
char
*
sig
);
bool
Check
(
jint
rc
=
0
);
...
...
storage/connect/jdbconn.cpp
View file @
26e2dd39
...
...
@@ -707,21 +707,14 @@ bool JDBConn::SetUUID(PGLOBAL g, PTDBJDBC tjp)
goto
err
;
}
// endif rc
//
Returns 666 is case of error
//jtyp = env->CallIntMethod(job, typ
id, 5, nullptr);
//
Should return 666 is case of error (not done yet)
ctyp
=
(
int
)
env
->
CallIntMethod
(
job
,
intfld
id
,
5
,
nullptr
);
//if (Check((
j
typ == 666) ? -1 : 1)) {
// sprintf(g->Message, "Getting
j
typ: %s", Msg);
//if (Check((
c
typ == 666) ? -1 : 1)) {
// sprintf(g->Message, "Getting
c
typ: %s", Msg);
// goto err;
//} // endif ctyp
ctyp
=
(
int
)
env
->
CallIntMethod
(
job
,
intfldid
,
5
,
nullptr
);
if
(
Check
(
ctyp
))
{
sprintf
(
g
->
Message
,
"Getting ctyp: %s"
,
Msg
);
goto
err
;
}
// endif ctyp
if
(
ctyp
==
1111
)
((
PJDBCCOL
)
colp
)
->
uuid
=
true
;
...
...
@@ -836,11 +829,11 @@ bool JDBConn::Connect(PJPARM sop)
jstring
s
=
(
jstring
)
env
->
CallObjectMethod
(
job
,
qcid
);
if
(
s
!=
nullptr
)
{
char
*
qch
=
(
char
*
)
env
->
GetStringUTFChars
(
s
,
(
jboolean
)
false
);
char
*
qch
=
GetUTFString
(
s
);
m_IDQuoteChar
[
0
]
=
*
qch
;
}
else
{
s
=
(
jstring
)
env
->
CallObjectMethod
(
job
,
errid
);
Msg
=
(
char
*
)
env
->
GetStringUTFChars
(
s
,
(
jboolean
)
false
);
Msg
=
GetUTFString
(
s
);
}
// endif s
}
// endif qcid
...
...
@@ -1018,7 +1011,7 @@ void JDBConn::SetColumnValue(int rank, PSZ name, PVAL val)
cn
=
nullptr
;
if
(
cn
)
{
field
=
env
->
GetStringUTFChars
(
cn
,
(
jboolean
)
false
);
field
=
GetUTFString
(
cn
);
val
->
SetValue_psz
((
PSZ
)
field
);
}
else
val
->
Reset
();
...
...
@@ -1092,8 +1085,7 @@ void JDBConn::SetColumnValue(int rank, PSZ name, PVAL val)
cn
=
nullptr
;
if
(
cn
)
{
const
char
*
field
=
env
->
GetStringUTFChars
(
cn
,
(
jboolean
)
false
);
val
->
SetValue_psz
((
PSZ
)
field
);
val
->
SetValue_psz
((
PSZ
)
GetUTFString
(
cn
));
}
else
val
->
Reset
();
...
...
@@ -1372,19 +1364,19 @@ bool JDBConn::SetParam(JDBCCOL *colp)
for
(
i
=
0
,
n
=
0
;
i
<
size
;
i
++
)
{
crp
=
qrp
->
Colresp
;
js
=
(
jstring
)
env
->
GetObjectArrayElement
(
s
,
n
++
);
sval
=
(
PSZ
)
env
->
GetStringUTFChars
(
js
,
0
);
sval
=
GetUTFString
(
js
);
crp
->
Kdata
->
SetValue
(
sval
,
i
);
crp
=
crp
->
Next
;
js
=
(
jstring
)
env
->
GetObjectArrayElement
(
s
,
n
++
);
sval
=
(
PSZ
)
env
->
GetStringUTFChars
(
js
,
0
);
sval
=
GetUTFString
(
js
);
crp
->
Kdata
->
SetValue
(
sval
,
i
);
crp
=
crp
->
Next
;
js
=
(
jstring
)
env
->
GetObjectArrayElement
(
s
,
n
++
);
sval
=
(
PSZ
)
env
->
GetStringUTFChars
(
js
,
0
);
sval
=
GetUTFString
(
js
);
crp
->
Kdata
->
SetValue
(
sval
,
i
);
crp
=
crp
->
Next
;
js
=
(
jstring
)
env
->
GetObjectArrayElement
(
s
,
n
++
);
sval
=
(
PSZ
)
env
->
GetStringUTFChars
(
js
,
0
);
sval
=
GetUTFString
(
js
);
crp
->
Kdata
->
SetValue
(
sval
,
i
);
}
// endfor i
...
...
@@ -1470,7 +1462,7 @@ bool JDBConn::SetParam(JDBCCOL *colp)
return
NULL
;
}
// endif label
name
=
env
->
GetStringUTFChars
(
label
,
(
jboolean
)
false
);
name
=
GetUTFString
(
label
);
crp
=
qrp
->
Colresp
;
// Column_Name
crp
->
Kdata
->
SetValue
((
char
*
)
name
,
i
);
n
=
env
->
GetIntArrayElements
(
val
,
0
);
...
...
storage/connect/jmgoconn.cpp
View file @
26e2dd39
...
...
@@ -522,7 +522,7 @@ PSZ JMgoConn::GetDocument(void)
jdc
=
(
jstring
)
env
->
CallObjectMethod
(
job
,
getdocid
);
if
(
jdc
)
doc
=
(
PSZ
)
env
->
GetStringUTFChars
(
jdc
,
(
jboolean
)
false
);
doc
=
(
PSZ
)
GetUTFString
(
jdc
);
}
// endif getdocid
...
...
@@ -690,7 +690,7 @@ jobject JMgoConn::MakeDoc(PGLOBAL g, PJNCOL jcp)
}
// endif Jncolp
return
parent
;
return
parent
;
}
// end of MakeDoc
/***********************************************************************/
...
...
@@ -807,7 +807,7 @@ PSZ JMgoConn::GetColumnValue(PSZ path)
fn
=
(
jstring
)
env
->
CallObjectMethod
(
job
,
objfldid
,
jn
);
if
(
fn
)
fld
=
(
PSZ
)
env
->
GetStringUTFChars
(
fn
,
(
jboolean
)
false
);
fld
=
(
PSZ
)
GetUTFString
(
fn
);
}
// endif objfldid
...
...
storage/connect/jsonudf.cpp
View file @
26e2dd39
...
...
@@ -4631,7 +4631,7 @@ char *jbin_array(UDF_INIT *initid, UDF_ARGS *args, char *result,
bsp
=
NULL
;
if
(
!
bsp
&&
(
bsp
=
JbinAlloc
(
g
,
args
,
initid
->
max_length
,
NULL
)))
strncpy
(
bsp
->
Msg
,
g
->
Message
,
139
);
strncpy
(
bsp
->
Msg
,
g
->
Message
,
BMX
);
// Keep result of constant function
g
->
Xchk
=
(
initid
->
const_item
)
?
bsp
:
NULL
;
...
...
storage/connect/mysql-test/connect/r/jdbc.result
View file @
26e2dd39
...
...
@@ -238,8 +238,7 @@ DROP TABLE t1, connect.emp;
CREATE TABLE t2 (command varchar(128) not null,number int(5) not null flag=1,message varchar(255) flag=2) ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:mariadb://localhost:PORT/connect' OPTION_LIST='User=root,Execsrc=1';
SELECT * FROM t2 WHERE command='drop table tx1';
command number message
drop table tx1 0 Execute: java.sql.SQLSyntaxErrorException: Unknown table 'connect.tx1'
Query is : drop table tx1
drop table tx1 0 Execute: java.sql.SQLSyntaxErrorException: (conn:24) Unknown table 'connect.tx1'
SELECT * FROM t2 WHERE command = 'create table tx1 (a int not null, b char(32), c double(8,2))';
command number message
create table tx1 (a int not null, b char(32), c double(8,2)) 0 Affected rows
...
...
storage/connect/tabjmg.cpp
View file @
26e2dd39
...
...
@@ -72,7 +72,7 @@ bool JMGDISC::Find(PGLOBAL g)
bool
JMGDISC
::
ColDesc
(
PGLOBAL
g
,
jobject
obj
,
char
*
pcn
,
char
*
pfmt
,
int
ncol
,
int
k
)
{
const
char
*
key
;
const
char
*
key
,
*
utf
;
char
colname
[
65
];
char
fmt
[
129
];
bool
rc
=
true
;
...
...
@@ -101,7 +101,10 @@ bool JMGDISC::ColDesc(PGLOBAL g, jobject obj, char *pcn, char *pfmt,
continue
;
jkey
=
(
jstring
)
Jcp
->
env
->
CallObjectMethod
(
Jcp
->
job
,
bvnameid
);
key
=
Jcp
->
env
->
GetStringUTFChars
(
jkey
,
(
jboolean
)
false
);
utf
=
Jcp
->
env
->
GetStringUTFChars
(
jkey
,
nullptr
);
key
=
PlugDup
(
g
,
utf
);
Jcp
->
env
->
ReleaseStringUTFChars
(
jkey
,
utf
);
Jcp
->
env
->
DeleteLocalRef
(
jkey
);
if
(
pcn
)
{
strncpy
(
colname
,
pcn
,
64
);
...
...
@@ -457,8 +460,8 @@ PSZ JMGCOL::GetJpath(PGLOBAL g, bool proj)
}
else
*
p2
++
=
*
p1
;
*
p2
=
0
;
return
projpath
;
*
p2
=
0
;
return
projpath
;
}
else
return
Jpath
;
...
...
storage/connect/tabpivot.cpp
View file @
26e2dd39
...
...
@@ -107,12 +107,12 @@ bool PIVAID::SkipColumn(PCOLRES crp, char *skc)
/***********************************************************************/
PQRYRES
PIVAID
::
MakePivotColumns
(
PGLOBAL
g
)
{
char
*
p
,
*
query
,
*
colname
,
*
skc
,
buf
[
64
];
int
ndif
,
nblin
,
w
=
0
;
bool
b
=
false
;
PVAL
valp
;
PQRYRES
qrp
;
PCOLRES
*
pcrp
,
crp
,
fncrp
=
NULL
;
char
*
p
,
*
query
,
*
colname
,
*
skc
,
buf
[
64
];
int
ndif
,
nblin
,
w
=
0
;
bool
b
=
false
;
PVAL
valp
;
PQRYRES
qrp
;
PCOLRES
*
pcrp
,
crp
,
fncrp
=
NULL
;
try
{
// Are there columns to skip?
...
...
@@ -186,7 +186,7 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g)
}
// endif picol
// Prepare the column list
// Prepare the column list
for
(
pcrp
=
&
Qryp
->
Colresp
;
crp
=
*
pcrp
;
)
if
(
SkipColumn
(
crp
,
skc
))
{
// Ignore this column
...
...
@@ -205,95 +205,95 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g)
}
else
pcrp
=
&
crp
->
Next
;
if
(
!
Rblkp
)
{
strcpy
(
g
->
Message
,
MSG
(
NO_DEF_PIVOTCOL
));
goto
err
;
}
else
if
(
!
fncrp
)
{
strcpy
(
g
->
Message
,
MSG
(
NO_DEF_FNCCOL
));
goto
err
;
}
// endif
if
(
!
Rblkp
)
{
strcpy
(
g
->
Message
,
MSG
(
NO_DEF_PIVOTCOL
));
goto
err
;
}
else
if
(
!
fncrp
)
{
strcpy
(
g
->
Message
,
MSG
(
NO_DEF_FNCCOL
));
goto
err
;
}
// endif
if
(
Tabsrc
)
{
Myc
.
Close
();
b
=
false
;
if
(
Tabsrc
)
{
Myc
.
Close
();
b
=
false
;
// Before calling sort, initialize all
nblin
=
Qryp
->
Nblin
;
// Before calling sort, initialize all
nblin
=
Qryp
->
Nblin
;
Index
.
Size
=
nblin
*
sizeof
(
int
);
Index
.
Sub
=
TRUE
;
// Should be small enough
Index
.
Size
=
nblin
*
sizeof
(
int
);
Index
.
Sub
=
TRUE
;
// Should be small enough
if
(
!
PlgDBalloc
(
g
,
NULL
,
Index
))
goto
err
;
if
(
!
PlgDBalloc
(
g
,
NULL
,
Index
))
goto
err
;
Offset
.
Size
=
(
nblin
+
1
)
*
sizeof
(
int
);
Offset
.
Sub
=
TRUE
;
// Should be small enough
Offset
.
Size
=
(
nblin
+
1
)
*
sizeof
(
int
);
Offset
.
Sub
=
TRUE
;
// Should be small enough
if
(
!
PlgDBalloc
(
g
,
NULL
,
Offset
))
goto
err
;
if
(
!
PlgDBalloc
(
g
,
NULL
,
Offset
))
goto
err
;
ndif
=
Qsort
(
g
,
nblin
);
ndif
=
Qsort
(
g
,
nblin
);
if
(
ndif
<
0
)
// error
goto
err
;
if
(
ndif
<
0
)
// error
goto
err
;
}
else
{
// The query was limited, we must get pivot column values
// Returned values must be in their original character set
// if (Myc.ExecSQL(g, "SET character_set_results=NULL", &w) == RC_FX)
// goto err;
}
else
{
// The query was limited, we must get pivot column values
// Returned values must be in their original character set
// if (Myc.ExecSQL(g, "SET character_set_results=NULL", &w) == RC_FX)
// goto err;
query
=
(
char
*
)
PlugSubAlloc
(
g
,
NULL
,
0
);
sprintf
(
query
,
"SELECT DISTINCT `%s` FROM `%s`"
,
Picol
,
Tabname
);
PlugSubAlloc
(
g
,
NULL
,
strlen
(
query
)
+
1
);
Myc
.
FreeResult
();
query
=
(
char
*
)
PlugSubAlloc
(
g
,
NULL
,
0
);
sprintf
(
query
,
"SELECT DISTINCT `%s` FROM `%s`"
,
Picol
,
Tabname
);
PlugSubAlloc
(
g
,
NULL
,
strlen
(
query
)
+
1
);
Myc
.
FreeResult
();
// Send the source command to MySQL
if
(
Myc
.
ExecSQL
(
g
,
query
,
&
w
)
==
RC_FX
)
goto
err
;
// Send the source command to MySQL
if
(
Myc
.
ExecSQL
(
g
,
query
,
&
w
)
==
RC_FX
)
goto
err
;
// We must have a storage query to get pivot column values
if
(
!
(
qrp
=
Myc
.
GetResult
(
g
,
true
)))
goto
err
;
// We must have a storage query to get pivot column values
if
(
!
(
qrp
=
Myc
.
GetResult
(
g
,
true
)))
goto
err
;
Myc
.
Close
();
b
=
false
;
Myc
.
Close
();
b
=
false
;
// Get the column list
crp
=
qrp
->
Colresp
;
Rblkp
=
crp
->
Kdata
;
ndif
=
qrp
->
Nblin
;
}
// endif Tabsrc
// Get the column list
crp
=
qrp
->
Colresp
;
Rblkp
=
crp
->
Kdata
;
ndif
=
qrp
->
Nblin
;
}
// endif Tabsrc
// Allocate the Value used to retieve column names
if
(
!
(
valp
=
AllocateValue
(
g
,
Rblkp
->
GetType
(),
Rblkp
->
GetVlen
(),
Rblkp
->
GetPrec
())))
goto
err
;
// Allocate the Value used to retieve column names
if
(
!
(
valp
=
AllocateValue
(
g
,
Rblkp
->
GetType
(),
Rblkp
->
GetVlen
(),
Rblkp
->
GetPrec
())))
goto
err
;
// Now make the functional columns
for
(
int
i
=
0
;
i
<
ndif
;
i
++
)
{
if
(
i
)
{
crp
=
(
PCOLRES
)
PlugSubAlloc
(
g
,
NULL
,
sizeof
(
COLRES
));
memcpy
(
crp
,
fncrp
,
sizeof
(
COLRES
));
}
else
crp
=
fncrp
;
// Get the value that will be the generated column name
if
(
Tabsrc
)
valp
->
SetValue_pvblk
(
Rblkp
,
Pex
[
Pof
[
i
]]);
else
valp
->
SetValue_pvblk
(
Rblkp
,
i
);
colname
=
valp
->
GetCharString
(
buf
);
crp
->
Name
=
PlugDup
(
g
,
colname
);
crp
->
Flag
=
1
;
// Add this column
*
pcrp
=
crp
;
crp
->
Next
=
NULL
;
pcrp
=
&
crp
->
Next
;
}
// endfor i
// Now make the functional columns
for
(
int
i
=
0
;
i
<
ndif
;
i
++
)
{
if
(
i
)
{
crp
=
(
PCOLRES
)
PlugSubAlloc
(
g
,
NULL
,
sizeof
(
COLRES
));
memcpy
(
crp
,
fncrp
,
sizeof
(
COLRES
));
}
else
crp
=
fncrp
;
// Get the value that will be the generated column name
if
(
Tabsrc
)
valp
->
SetValue_pvblk
(
Rblkp
,
Pex
[
Pof
[
i
]]);
else
valp
->
SetValue_pvblk
(
Rblkp
,
i
);
colname
=
valp
->
GetCharString
(
buf
);
crp
->
Name
=
PlugDup
(
g
,
colname
);
crp
->
Flag
=
1
;
// Add this column
*
pcrp
=
crp
;
crp
->
Next
=
NULL
;
pcrp
=
&
crp
->
Next
;
}
// endfor i
// We added ndif columns and removed 2 (picol and fncol)
Qryp
->
Nbcol
+=
(
ndif
-
2
);
...
...
@@ -306,10 +306,10 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g)
}
// end catch
err:
if
(
b
)
Myc
.
Close
();
if
(
b
)
Myc
.
Close
();
return
NULL
;
return
NULL
;
}
// end of MakePivotColumns
/***********************************************************************/
...
...
storage/connect/tabutil.cpp
View file @
26e2dd39
...
...
@@ -429,7 +429,7 @@ PTDB TDBPRX::GetSubTable(PGLOBAL g, PTABLE tabp, bool b)
char
buf
[
MAX_STR
];
strcpy
(
buf
,
g
->
Message
);
s
printf
(
g
->
Message
,
"Error accessing %s.%s: %s"
,
db
,
name
,
buf
);
s
nprintf
(
g
->
Message
,
MAX_STR
,
"Error accessing %s.%s: %s"
,
db
,
name
,
buf
);
hc
->
tshp
=
NULL
;
goto
err
;
}
// endif Define
...
...
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