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
0b9ea65d
Commit
0b9ea65d
authored
Aug 10, 2017
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make source from 10.2 source
parent
9e5ca80a
Changes
28
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
117 additions
and
305 deletions
+117
-305
storage/connect/jmgoconn.cpp
storage/connect/jmgoconn.cpp
+2
-2
storage/connect/json.cpp
storage/connect/json.cpp
+13
-3
storage/connect/json.h
storage/connect/json.h
+4
-2
storage/connect/jsonudf.cpp
storage/connect/jsonudf.cpp
+44
-22
storage/connect/mongo.cpp
storage/connect/mongo.cpp
+5
-4
storage/connect/myconn.cpp
storage/connect/myconn.cpp
+4
-2
storage/connect/mysql-test/connect/r/bin.result
storage/connect/mysql-test/connect/r/bin.result
+2
-2
storage/connect/mysql-test/connect/r/dir.result
storage/connect/mysql-test/connect/r/dir.result
+1
-1
storage/connect/mysql-test/connect/r/grant.result
storage/connect/mysql-test/connect/r/grant.result
+0
-58
storage/connect/mysql-test/connect/r/grant2.result
storage/connect/mysql-test/connect/r/grant2.result
+0
-79
storage/connect/mysql-test/connect/r/ini_grant.result
storage/connect/mysql-test/connect/r/ini_grant.result
+0
-8
storage/connect/mysql-test/connect/r/jdbc_new.result
storage/connect/mysql-test/connect/r/jdbc_new.result
+2
-19
storage/connect/mysql-test/connect/r/mysql.result
storage/connect/mysql-test/connect/r/mysql.result
+1
-1
storage/connect/mysql-test/connect/r/mysql_discovery.result
storage/connect/mysql-test/connect/r/mysql_discovery.result
+2
-11
storage/connect/mysql-test/connect/r/mysql_exec.result
storage/connect/mysql-test/connect/r/mysql_exec.result
+0
-8
storage/connect/mysql-test/connect/r/mysql_grant.result
storage/connect/mysql-test/connect/r/mysql_grant.result
+0
-8
storage/connect/mysql-test/connect/r/mysql_new.result
storage/connect/mysql-test/connect/r/mysql_new.result
+3
-22
storage/connect/mysql-test/connect/r/tbl_thread.result
storage/connect/mysql-test/connect/r/tbl_thread.result
+1
-13
storage/connect/mysql-test/connect/r/xml_grant.result
storage/connect/mysql-test/connect/r/xml_grant.result
+0
-10
storage/connect/mysql-test/connect/r/xml_mdev5261.result
storage/connect/mysql-test/connect/r/xml_mdev5261.result
+2
-2
storage/connect/mysql-test/connect/t/dir.test
storage/connect/mysql-test/connect/t/dir.test
+3
-1
storage/connect/mysql-test/connect/t/tbl_thread.test
storage/connect/mysql-test/connect/t/tbl_thread.test
+1
-0
storage/connect/odbconn.cpp
storage/connect/odbconn.cpp
+8
-0
storage/connect/os.h
storage/connect/os.h
+1
-1
storage/connect/plgdbutl.cpp
storage/connect/plgdbutl.cpp
+5
-8
storage/connect/reldef.cpp
storage/connect/reldef.cpp
+3
-3
storage/connect/tabjson.cpp
storage/connect/tabjson.cpp
+10
-14
storage/connect/tabjson.h
storage/connect/tabjson.h
+0
-1
No files found.
storage/connect/jmgoconn.cpp
View file @
0b9ea65d
...
...
@@ -732,7 +732,7 @@ int JMgoConn::DocUpdate(PGLOBAL g, PTDB tdbp)
return
RC_FX
;
if
(
env
->
CallBooleanMethod
(
job
,
docaddid
,
updlist
,
jkey
,
val
))
return
NULL
;
return
RC_OK
;
env
->
DeleteLocalRef
(
jkey
);
}
// endfor colp
...
...
@@ -742,7 +742,7 @@ int JMgoConn::DocUpdate(PGLOBAL g, PTDB tdbp)
jkey
=
env
->
NewStringUTF
(
"$set"
);
if
(
env
->
CallBooleanMethod
(
job
,
docaddid
,
upd
,
jkey
,
updlist
))
return
NULL
;
return
RC_OK
;
env
->
DeleteLocalRef
(
jkey
);
...
...
storage/connect/json.cpp
View file @
0b9ea65d
...
...
@@ -1403,10 +1403,20 @@ double JVALUE::GetFloat(void)
/***********************************************************************/
/* Return the Value's String value. */
/***********************************************************************/
PSZ
JVALUE
::
GetString
(
void
)
PSZ
JVALUE
::
GetString
(
PGLOBAL
g
)
{
char
buf
[
32
];
return
(
Value
)
?
Value
->
GetCharString
(
buf
)
:
NULL
;
char
*
p
;
if
(
Value
)
{
char
buf
[
32
];
if
((
p
=
Value
->
GetCharString
(
buf
))
==
buf
)
p
=
PlugDup
(
g
,
buf
);
}
else
p
=
NULL
;
return
p
;
}
// end of GetString
/***********************************************************************/
...
...
storage/connect/json.h
View file @
0b9ea65d
...
...
@@ -53,6 +53,8 @@ PSZ Serialize(PGLOBAL g, PJSON jsp, char *fn, int pretty);
bool
SerializeArray
(
JOUT
*
js
,
PJAR
jarp
,
bool
b
);
bool
SerializeObject
(
JOUT
*
js
,
PJOB
jobp
);
bool
SerializeValue
(
JOUT
*
js
,
PJVAL
jvp
);
bool
IsNum
(
PSZ
s
);
char
*
NextChr
(
PSZ
s
,
char
sep
);
/***********************************************************************/
/* Class JOUT. Used by Serialize. */
...
...
@@ -165,7 +167,7 @@ class JSON : public BLOCK {
virtual
PJPR
GetFirst
(
void
)
{
X
return
NULL
;}
virtual
int
GetInteger
(
void
)
{
X
return
0
;}
virtual
double
GetFloat
()
{
X
return
0.0
;}
virtual
PSZ
GetString
()
{
X
return
NULL
;}
virtual
PSZ
GetString
(
PGLOBAL
g
)
{
X
return
NULL
;}
virtual
PSZ
GetText
(
PGLOBAL
g
,
PSZ
text
)
{
X
return
NULL
;}
virtual
bool
Merge
(
PGLOBAL
g
,
PJSON
jsp
)
{
X
return
true
;
}
virtual
bool
SetValue
(
PGLOBAL
g
,
PJVAL
jvp
,
int
i
)
{
X
return
true
;
}
...
...
@@ -275,7 +277,7 @@ class JVALUE : public JSON {
virtual
int
GetInteger
(
void
);
virtual
long
long
GetBigint
(
void
);
virtual
double
GetFloat
(
void
);
virtual
PSZ
GetString
(
void
);
virtual
PSZ
GetString
(
PGLOBAL
g
);
virtual
PSZ
GetText
(
PGLOBAL
g
,
PSZ
text
);
virtual
void
SetValue
(
PJSON
jsp
);
virtual
void
SetValue
(
PVAL
valp
)
{
Value
=
valp
;
Jsp
=
NULL
;
}
...
...
storage/connect/jsonudf.cpp
View file @
0b9ea65d
...
...
@@ -143,7 +143,7 @@ my_bool JSNX::SetArrayOptions(PGLOBAL g, char *p, int i, PSZ nm)
jnp
->
Rank
=
B
;
jnp
->
Op
=
OP_LE
;
}
else
if
(
!
Value
->
IsTypeNum
())
{
jnp
->
CncVal
=
AllocateValue
(
g
,
(
void
*
)
", "
,
TYPE_STRING
);
jnp
->
CncVal
=
AllocateValue
(
g
,
PlugDup
(
g
,
", "
)
,
TYPE_STRING
);
jnp
->
Op
=
OP_CNC
;
}
else
jnp
->
Op
=
OP_ADD
;
...
...
@@ -181,6 +181,10 @@ my_bool JSNX::SetArrayOptions(PGLOBAL g, char *p, int i, PSZ nm)
if
(
n
>
2
)
{
// Set concat intermediate string
p
[
n
-
1
]
=
0
;
if
(
trace
)
htrc
(
"Concat string=%s
\n
"
,
p
+
1
);
jnp
->
CncVal
=
AllocateValue
(
g
,
p
+
1
,
TYPE_STRING
);
}
// endif n
...
...
@@ -242,6 +246,9 @@ my_bool JSNX::ParseJpath(PGLOBAL g)
// Jpath = Name;
return
true
;
if
(
trace
)
htrc
(
"ParseJpath %s
\n
"
,
SVP
(
Jpath
));
if
(
!
(
pbuf
=
PlgDBDup
(
g
,
Jpath
)))
return
true
;
...
...
@@ -301,6 +308,12 @@ my_bool JSNX::ParseJpath(PGLOBAL g)
Nod
=
i
;
MulVal
=
AllocateValue
(
g
,
Value
);
if
(
trace
)
for
(
i
=
0
;
i
<
Nod
;
i
++
)
htrc
(
"Node(%d) Key=%s Op=%d Rank=%d
\n
"
,
i
,
SVP
(
Nodes
[
i
].
Key
),
Nodes
[
i
].
Op
,
Nodes
[
i
].
Rank
);
Parsed
=
true
;
return
false
;
}
// end of ParseJpath
...
...
@@ -485,7 +498,7 @@ PVAL JSNX::ExpandArray(PGLOBAL g, PJAR arp, int n)
PVAL
JSNX
::
CalculateArray
(
PGLOBAL
g
,
PJAR
arp
,
int
n
)
{
//int i, ars, nv = 0, nextsame = Tjp->NextSame;
int
i
,
ars
,
nv
=
0
,
nextsame
=
0
;
int
i
,
nv
=
0
,
nextsame
=
0
;
my_bool
err
;
OPVAL
op
=
Nodes
[
n
].
Op
;
PVAL
val
[
2
],
vp
=
Nodes
[
n
].
Valp
;
...
...
@@ -493,11 +506,20 @@ PVAL JSNX::CalculateArray(PGLOBAL g, PJAR arp, int n)
JVALUE
jval
;
vp
->
Reset
();
ars
=
arp
->
size
();
//ars = arp->size();
if
(
trace
)
htrc
(
"CalculateArray size=%d
\n
"
,
arp
->
size
());
// htrc("CalculateArray size=%d\n", ars);
for
(
i
=
0
;
i
<
ars
;
i
++
)
{
for
(
i
=
0
;
i
<
arp
->
size
();
i
++
)
{
//for (i = 0; i < ars; i++) { because compiler bug
jvrp
=
arp
->
GetValue
(
i
);
if
(
trace
)
htrc
(
"Value %s null=%d nv=%d
\n
"
,
jvrp
->
GetString
(
g
),
jvrp
->
IsNull
()
?
1
:
0
,
nv
);
if
(
!
jvrp
->
IsNull
()
||
(
op
==
OP_CNC
&&
GetJsonNull
()))
{
if
(
jvrp
->
IsNull
())
{
jvrp
->
Value
=
AllocateValue
(
g
,
GetJsonNull
(),
TYPE_STRING
);
...
...
@@ -514,8 +536,8 @@ PVAL JSNX::CalculateArray(PGLOBAL g, PJAR arp, int n)
}
else
SetJsonValue
(
g
,
MulVal
,
jvp
,
n
);
if
(
!
MulVal
->
Is
Zero
())
{
switch
(
op
)
{
if
(
!
MulVal
->
Is
Null
())
{
switch
(
op
)
{
case
OP_CNC
:
if
(
Nodes
[
n
].
CncVal
)
{
val
[
0
]
=
Nodes
[
n
].
CncVal
;
...
...
@@ -1876,7 +1898,7 @@ char *json_array_add_values(UDF_INIT *initid, UDF_ARGS *args, char *result,
PJAR
arp
;
PJVAL
jvp
=
MakeValue
(
g
,
args
,
0
,
&
top
);
if
((
p
=
jvp
->
GetString
()))
{
if
((
p
=
jvp
->
GetString
(
g
)))
{
if
(
!
(
top
=
ParseJson
(
g
,
p
,
strlen
(
p
))))
{
PUSH_WARNING
(
g
->
Message
);
return
NULL
;
...
...
@@ -2666,7 +2688,7 @@ char *json_object_list(UDF_INIT *initid, UDF_ARGS *args, char *result,
PJSON
jsp
;
PJVAL
jvp
=
MakeValue
(
g
,
args
,
0
);
if
((
p
=
jvp
->
GetString
()))
{
if
((
p
=
jvp
->
GetString
(
g
)))
{
if
(
!
(
jsp
=
ParseJson
(
g
,
p
,
strlen
(
p
))))
{
PUSH_WARNING
(
g
->
Message
);
return
NULL
;
...
...
@@ -3050,7 +3072,7 @@ char *json_get_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
}
else
jvp
=
MakeValue
(
g
,
args
,
0
);
if
((
p
=
jvp
->
GetString
()))
{
if
((
p
=
jvp
->
GetString
(
g
)))
{
if
(
!
(
jsp
=
ParseJson
(
g
,
p
,
strlen
(
p
))))
{
PUSH_WARNING
(
g
->
Message
);
return
NULL
;
...
...
@@ -3165,7 +3187,7 @@ char *jsonget_string(UDF_INIT *initid, UDF_ARGS *args, char *result,
}
else
jvp
=
MakeValue
(
g
,
args
,
0
);
if
((
p
=
jvp
->
GetString
()))
{
if
((
p
=
jvp
->
GetString
(
g
)))
{
if
(
!
(
jsp
=
ParseJson
(
g
,
p
,
strlen
(
p
))))
{
PUSH_WARNING
(
g
->
Message
);
goto
err
;
...
...
@@ -3280,7 +3302,7 @@ long long jsonget_int(UDF_INIT *initid, UDF_ARGS *args,
}
else
jvp
=
MakeValue
(
g
,
args
,
0
);
if
((
p
=
jvp
->
GetString
()))
{
if
((
p
=
jvp
->
GetString
(
g
)))
{
if
(
!
(
jsp
=
ParseJson
(
g
,
p
,
strlen
(
p
))))
{
PUSH_WARNING
(
g
->
Message
);
if
(
g
->
Mrr
)
*
error
=
1
;
...
...
@@ -3395,7 +3417,7 @@ double jsonget_real(UDF_INIT *initid, UDF_ARGS *args,
}
else
jvp
=
MakeValue
(
g
,
args
,
0
);
if
((
p
=
jvp
->
GetString
()))
{
if
((
p
=
jvp
->
GetString
(
g
)))
{
if
(
!
(
jsp
=
ParseJson
(
g
,
p
,
strlen
(
p
))))
{
PUSH_WARNING
(
g
->
Message
);
*
is_null
=
1
;
...
...
@@ -3511,7 +3533,7 @@ char *jsonlocate(UDF_INIT *initid, UDF_ARGS *args, char *result,
}
else
jvp
=
MakeValue
(
g
,
args
,
0
);
if
((
p
=
jvp
->
GetString
()))
{
if
((
p
=
jvp
->
GetString
(
g
)))
{
if
(
!
(
jsp
=
ParseJson
(
g
,
p
,
strlen
(
p
))))
{
PUSH_WARNING
(
g
->
Message
);
goto
err
;
...
...
@@ -3635,7 +3657,7 @@ char *json_locate_all(UDF_INIT *initid, UDF_ARGS *args, char *result,
}
else
jvp
=
MakeValue
(
g
,
args
,
0
);
if
((
p
=
jvp
->
GetString
()))
{
if
((
p
=
jvp
->
GetString
(
g
)))
{
if
(
!
(
jsp
=
ParseJson
(
g
,
p
,
strlen
(
p
))))
{
PUSH_WARNING
(
g
->
Message
);
goto
err
;
...
...
@@ -3807,7 +3829,7 @@ long long jsoncontains_path(UDF_INIT *initid, UDF_ARGS *args, char *result,
}
else
jvp
=
MakeValue
(
g
,
args
,
0
);
if
((
p
=
jvp
->
GetString
()))
{
if
((
p
=
jvp
->
GetString
(
g
)))
{
if
(
!
(
jsp
=
ParseJson
(
g
,
p
,
strlen
(
p
))))
{
PUSH_WARNING
(
g
->
Message
);
goto
err
;
...
...
@@ -3894,7 +3916,7 @@ char *handle_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
}
else
jvp
=
MakeValue
(
g
,
args
,
0
);
if
((
p
=
jvp
->
GetString
()))
{
if
((
p
=
jvp
->
GetString
(
g
)))
{
if
(
!
(
jsp
=
ParseJson
(
g
,
p
,
strlen
(
p
))))
{
throw
2
;
}
// endif jsp
...
...
@@ -4230,14 +4252,14 @@ char *jfile_make(UDF_INIT *initid, UDF_ARGS *args, char *result,
}
else
jvp
=
MakeValue
(
g
,
args
,
0
);
if
((
p
=
jvp
->
GetString
()))
{
if
((
p
=
jvp
->
GetString
(
g
)))
{
if
(
!
strchr
(
"[{
\t\r\n
"
,
*
p
))
{
// Is this a file name?
if
(
!
(
p
=
GetJsonFile
(
g
,
p
)))
{
PUSH_WARNING
(
g
->
Message
);
goto
fin
;
}
else
fn
=
jvp
->
GetString
();
fn
=
jvp
->
GetString
(
g
);
}
// endif p
...
...
@@ -4380,7 +4402,7 @@ char *jbin_array_add_values(UDF_INIT *initid, UDF_ARGS *args, char *result,
PJVAL
jvp
=
MakeValue
(
g
,
args
,
0
,
&
top
);
PGLOBAL
gb
=
GetMemPtr
(
g
,
args
,
0
);
if
((
p
=
jvp
->
GetString
()))
{
if
((
p
=
jvp
->
GetString
(
g
)))
{
if
(
!
(
top
=
ParseJson
(
g
,
p
,
strlen
(
p
))))
{
PUSH_WARNING
(
g
->
Message
);
return
NULL
;
...
...
@@ -4918,7 +4940,7 @@ char *jbin_object_list(UDF_INIT *initid, UDF_ARGS *args, char *result,
PJSON
jsp
;
PJVAL
jvp
=
MakeValue
(
g
,
args
,
0
);
if
((
p
=
jvp
->
GetString
()))
{
if
((
p
=
jvp
->
GetString
(
g
)))
{
if
(
!
(
jsp
=
ParseJson
(
g
,
p
,
strlen
(
p
))))
{
PUSH_WARNING
(
g
->
Message
);
return
NULL
;
...
...
@@ -4989,7 +5011,7 @@ char *jbin_get_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
}
else
jvp
=
MakeValue
(
g
,
args
,
0
);
if
((
p
=
jvp
->
GetString
()))
{
if
((
p
=
jvp
->
GetString
(
g
)))
{
if
(
!
(
jsp
=
ParseJson
(
g
,
p
,
strlen
(
p
))))
{
PUSH_WARNING
(
g
->
Message
);
goto
fin
;
...
...
@@ -5163,7 +5185,7 @@ char *bin_handle_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
}
else
jvp
=
MakeValue
(
g
,
args
,
0
);
if
((
p
=
jvp
->
GetString
()))
{
if
((
p
=
jvp
->
GetString
(
g
)))
{
if
(
!
(
jsp
=
ParseJson
(
g
,
p
,
strlen
(
p
))))
{
PUSH_WARNING
(
g
->
Message
);
goto
fin
;
...
...
storage/connect/mongo.cpp
View file @
0b9ea65d
...
...
@@ -47,6 +47,7 @@ PQRYRES MGOColumns(PGLOBAL g, PCSZ db, PCSZ uri, PTOS topt, bool info)
unsigned
int
length
[]
=
{
0
,
6
,
8
,
10
,
10
,
6
,
6
,
0
};
int
ncol
=
sizeof
(
buftyp
)
/
sizeof
(
int
);
int
i
,
n
=
0
;
PCSZ
drv
;
PBCOL
bcp
;
MGODISC
*
cmgd
;
PQRYRES
qrp
;
...
...
@@ -61,7 +62,7 @@ PQRYRES MGOColumns(PGLOBAL g, PCSZ db, PCSZ uri, PTOS topt, bool info)
/*********************************************************************/
/* Open MongoDB. */
/*********************************************************************/
PCSZ
drv
=
GetStringTableOption
(
g
,
topt
,
"Driver"
,
NULL
);
drv
=
GetStringTableOption
(
g
,
topt
,
"Driver"
,
NULL
);
if
(
drv
&&
toupper
(
*
drv
)
==
'C'
)
{
#if defined(CMGO_SUPPORT)
...
...
@@ -256,7 +257,7 @@ void MGODISC::AddColumn(PGLOBAL g, PCSZ colname, PCSZ fmt, int k)
if
(
k
&&
*
fmt
&&
(
!
bcp
->
Fmt
||
strlen
(
bcp
->
Fmt
)
<
strlen
(
fmt
)))
{
bcp
->
Fmt
=
PlugDup
(
g
,
fmt
);
length
[
7
]
=
MY_MAX
(
length
[
7
],
strlen
(
fmt
));
length
[
7
]
=
MY_MAX
(
length
[
7
],
(
signed
)
strlen
(
fmt
));
}
// endif *fmt
bcp
->
Len
=
MY_MAX
(
bcp
->
Len
,
bcol
.
Len
);
...
...
@@ -269,11 +270,11 @@ void MGODISC::AddColumn(PGLOBAL g, PCSZ colname, PCSZ fmt, int k)
*
bcp
=
bcol
;
bcp
->
Cbn
|=
(
i
>
1
);
bcp
->
Name
=
PlugDup
(
g
,
colname
);
length
[
0
]
=
MY_MAX
(
length
[
0
],
strlen
(
colname
));
length
[
0
]
=
MY_MAX
(
length
[
0
],
(
signed
)
strlen
(
colname
));
if
(
k
)
{
bcp
->
Fmt
=
PlugDup
(
g
,
fmt
);
length
[
7
]
=
MY_MAX
(
length
[
7
],
strlen
(
fmt
));
length
[
7
]
=
MY_MAX
(
length
[
7
],
(
signed
)
strlen
(
fmt
));
}
else
bcp
->
Fmt
=
NULL
;
...
...
storage/connect/myconn.cpp
View file @
0b9ea65d
...
...
@@ -139,7 +139,7 @@ PQRYRES MyColumns(PGLOBAL g, THD *thd, const char *host, const char *db,
unsigned
int
length
[]
=
{
0
,
4
,
0
,
4
,
4
,
4
,
4
,
4
,
0
,
0
,
0
,
0
,
0
};
PCSZ
fmt
;
char
*
fld
,
*
colname
,
*
chset
,
v
,
buf
[
128
],
uns
[
16
],
zero
[
16
];
int
i
,
n
,
nf
,
ncol
=
sizeof
(
buftyp
)
/
sizeof
(
int
);
int
i
,
n
,
nf
=
0
,
ncol
=
sizeof
(
buftyp
)
/
sizeof
(
int
);
int
len
,
type
,
prec
,
rc
,
k
=
0
;
bool
b
;
PQRYRES
qrp
;
...
...
@@ -160,7 +160,9 @@ PQRYRES MyColumns(PGLOBAL g, THD *thd, const char *host, const char *db,
/* Do an evaluation of the result size. */
/********************************************************************/
STRING
cmd
(
g
,
64
,
"SHOW FULL COLUMNS FROM "
);
b
=
cmd
.
Append
((
PSZ
)
table
);
b
=
cmd
.
Append
(
'`'
);
b
|=
cmd
.
Append
((
PSZ
)
table
);
b
|=
cmd
.
Append
(
'`'
);
b
|=
cmd
.
Append
(
" FROM "
);
b
|=
cmd
.
Append
((
PSZ
)(
db
?
db
:
PlgGetUser
(
g
)
->
DBName
));
...
...
storage/connect/mysql-test/connect/r/bin.result
View file @
0b9ea65d
...
...
@@ -57,7 +57,7 @@ t1 CREATE TABLE `t1` (
`name` char(10) NOT NULL,
`birth` date NOT NULL,
`id` char(5) NOT NULL `FIELD_FORMAT`='S',
`salary` double(9,2) NOT NULL DEFAULT
0.00
`FIELD_FORMAT`='F',
`salary` double(9,2) NOT NULL DEFAULT
'0.00'
`FIELD_FORMAT`='F',
`dept` int(4) NOT NULL `FIELD_FORMAT`='S'
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=BIN `FILE_NAME`='Testbal.dat' `OPTION_LIST`='Endian=Little' `READONLY`=NO
INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777);
...
...
@@ -76,7 +76,7 @@ t1 CREATE TABLE `t1` (
`name` char(10) NOT NULL,
`birth` date NOT NULL,
`id` char(5) NOT NULL `FIELD_FORMAT`='S',
`salary` double(9,2) NOT NULL DEFAULT
0.00
`FIELD_FORMAT`='F',
`salary` double(9,2) NOT NULL DEFAULT
'0.00'
`FIELD_FORMAT`='F',
`dept` int(4) NOT NULL `FIELD_FORMAT`='S'
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=BIN `FILE_NAME`='Testbal.dat' `OPTION_LIST`='Endian=Little' `READONLY`=YES
INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777);
...
...
storage/connect/mysql-test/connect/r/dir.result
View file @
0b9ea65d
...
...
@@ -26,7 +26,7 @@ fname ftype size
boys .txt 282
boyswin .txt 288
INSERT INTO t1 VALUES ('','','','');
ERROR
22007: Incorrect double value: '' for column 'size' at row 1
ERROR
HY000: Got error 174 'COLBLK SetBuffer: undefined Access Method' from CONNECT
DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*.txt';
ERROR HY000: Cannot get column info for table type DIR
storage/connect/mysql-test/connect/r/grant.result
View file @
0b9ea65d
This diff is collapsed.
Click to expand it.
storage/connect/mysql-test/connect/r/grant2.result
View file @
0b9ea65d
This diff is collapsed.
Click to expand it.
storage/connect/mysql-test/connect/r/ini_grant.result
View file @
0b9ea65d
...
...
@@ -5,8 +5,6 @@ set sql_mode="";
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
set sql_mode=default;
connect user,localhost,user,,;
connection user;
SELECT user();
user()
user@localhost
...
...
@@ -35,13 +33,11 @@ DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
connection default;
SELECT user();
user()
root@localhost
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
INSERT INTO t1 VALUES ('sec1','val1');
connection user;
SELECT user();
user()
user@localhost
...
...
@@ -62,12 +58,10 @@ ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
user()
root@localhost
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
connection user;
SELECT user();
user()
user@localhost
...
...
@@ -79,8 +73,6 @@ UPDATE v1 SET val='val11';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
disconnect user;
connection default;
DROP VIEW v1;
DROP TABLE t1;
DROP USER user@localhost;
...
...
storage/connect/mysql-test/connect/r/jdbc_new.result
View file @
0b9ea65d
connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
connection master;
connection slave;
SET GLOBAL time_zone='+1:00';
CREATE TABLE t1 (a int, b char(10));
INSERT INTO t1 VALUES (NULL,NULL),(0,'test00'),(1,'test01'),(2,'test02'),(3,'test03');
...
...
@@ -15,7 +11,6 @@ NULL NULL
#
# Testing errors
#
connection master;
SET GLOBAL time_zone='+1:00';
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC
CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=unknown';
...
...
@@ -41,14 +36,10 @@ ERROR HY000: Got error 174 'ExecuteQuery: java.sql.SQLSyntaxErrorException: Unkn
DROP TABLE t1;
CREATE TABLE t1 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=JDBC
CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root';
connection slave;
ALTER TABLE t1 RENAME t1backup;
connection master;
SELECT * FROM t1;
ERROR HY000: Got error 174 'ExecuteQuery: java.sql.SQLSyntaxErrorException: Table 'test.t1' doesn't exist' from CONNECT
connection slave;
ALTER TABLE t1backup RENAME t1;
connection master;
DROP TABLE t1;
#
# Testing SELECT, etc.
...
...
@@ -117,7 +108,6 @@ NULL NULL
2 0
3 0
DROP TABLE t1;
connection slave;
DROP TABLE t1;
#
# Testing numeric data types
...
...
@@ -136,7 +126,6 @@ t1 CREATE TABLE `t1` (
`h` decimal(20,5) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES(100,3333,41235,1234567890,235000000000,3.14159265,3.14159265,3141.59265);
connection master;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC
CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root';
SHOW CREATE TABLE t1;
...
...
@@ -155,7 +144,6 @@ SELECT * FROM t1;
a b c d e f g h
100 3333 41235 1234567890 235000000000 3 3 3141.59265
DROP TABLE t1;
connection slave;
DROP TABLE t1;
#
# Testing character data types
...
...
@@ -171,7 +159,6 @@ INSERT INTO t1 VALUES('Welcome','Hello, World');
SELECT * FROM t1;
a b
Welcome Hello, World
connection master;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC
CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root';
SHOW CREATE TABLE t1;
...
...
@@ -184,7 +171,6 @@ SELECT * FROM t1;
a b
Welcome Hello, World
DROP TABLE t1;
connection slave;
DROP TABLE t1;
#
# Testing temporal data types
...
...
@@ -196,7 +182,7 @@ t1 CREATE TABLE `t1` (
`a` date DEFAULT NULL,
`b` datetime DEFAULT NULL,
`c` time DEFAULT NULL,
`d` timestamp NOT NULL DEFAULT
current_timestamp() ON UPDATE current_timestamp()
,
`d` timestamp NOT NULL DEFAULT
CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
,
`e` year(4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT IGNORE INTO t1 VALUES('2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23');
...
...
@@ -207,7 +193,6 @@ Warning 1265 Data truncated for column 'e' at row 1
SELECT * FROM t1;
a b c d e
2003-05-27 2003-05-27 10:45:23 10:45:23 2003-05-27 10:45:23 2003
connection master;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC
CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root';
SHOW CREATE TABLE t1;
...
...
@@ -216,15 +201,13 @@ t1 CREATE TABLE `t1` (
`a` date DEFAULT NULL,
`b` datetime DEFAULT NULL,
`c` time DEFAULT NULL,
`d` timestamp NOT NULL DEFAULT
current_timestamp() ON UPDATE current_timestamp()
,
`d` timestamp NOT NULL DEFAULT
CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
,
`e` year(4) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='jdbc:mysql://127.0.0.1:SLAVE_PORT/test?user=root' `TABLE_TYPE`='JDBC'
SELECT * FROM t1;
a b c d e
2003-05-27 2003-05-27 11:45:23 10:45:23 2003-05-27 10:45:23 2003
DROP TABLE t1;
connection slave;
DROP TABLE t1;
SET GLOBAL time_zone=SYSTEM;
connection master;
SET GLOBAL time_zone=SYSTEM;
storage/connect/mysql-test/connect/r/mysql.result
View file @
0b9ea65d
...
...
@@ -17,7 +17,7 @@ ERROR HY000: (1049) Unknown database 'unknown'
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL OPTION_LIST='host=localhost,user=root,port=PORT' DBNAME='unknown' TABNAME='t1';
ERROR HY000: (1049) Unknown database 'unknown'
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='unknown' OPTION_LIST='host=localhost,user=root,port=PORT';
ERROR HY000: (1146) Table 'test.unknown' doesn't exist [SHOW FULL COLUMNS FROM
unknown
FROM test]
ERROR HY000: (1146) Table 'test.unknown' doesn't exist [SHOW FULL COLUMNS FROM
`unknown`
FROM test]
SHOW CREATE TABLE t2;
ERROR 42S02: Table 'test.t2' doesn't exist
CREATE TABLE t2 (x int, y char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT';
...
...
storage/connect/mysql-test/connect/r/mysql_discovery.result
View file @
0b9ea65d
connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
connection master;
CREATE DATABASE connect;
connection slave;
CREATE DATABASE connect;
connection slave;
CREATE TABLE t1 (
`id` int(20) primary key,
`group` int NOT NULL default 1,
...
...
@@ -12,15 +7,14 @@ CREATE TABLE t1 (
`a\\` int unsigned,
`name` varchar(32) default 'name')
DEFAULT CHARSET=latin1;
connection master;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(20) NOT NULL,
`group` int(11) NOT NULL DEFAULT
1
,
`a\\b` int(11) NOT NULL DEFAULT
2
,
`group` int(11) NOT NULL DEFAULT
'1'
,
`a\\b` int(11) NOT NULL DEFAULT
'2'
,
`a\\` int(10) unsigned DEFAULT NULL,
`name` varchar(32) DEFAULT 'name'
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1' `TABLE_TYPE`='MYSQL'
...
...
@@ -31,15 +25,12 @@ id group a\\b a\\ name
1 1 2 NULL foo
2 1 2 NULL fee
DROP TABLE t1;
connection slave;
SELECT * FROM t1;
id group a\\b a\\ name
1 1 2 NULL foo
2 1 2 NULL fee
DROP TABLE t1;
connection master;
DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect;
connection slave;
DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect;
storage/connect/mysql-test/connect/r/mysql_exec.result
View file @
0b9ea65d
connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
connection master;
CREATE DATABASE connect;
connection slave;
CREATE DATABASE connect;
#
# Checking Sending Commands
#
connection master;
CREATE TABLE t1 (
command VARCHAR(128) NOT NULL,
warnings INT(4) NOT NULL FLAG=3,
...
...
@@ -53,7 +48,6 @@ command warnings number message
update t1 set msg = "Five" where id = 5 0 1 Affected rows
DROP PROCEDURE p1;
DROP TABLE t1;
connection slave;
SELECT * FROM t1;
id msg
1 One
...
...
@@ -62,9 +56,7 @@ id msg
4 Four
5 Five
DROP TABLE t1;
connection master;
DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect;
connection slave;
DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect;
storage/connect/mysql-test/connect/r/mysql_grant.result
View file @
0b9ea65d
...
...
@@ -5,14 +5,11 @@ set sql_mode="";
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
set sql_mode=default;
connect user,localhost,user,,;
connection user;
SELECT user();
user()
user@localhost
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=MySQL OPTION_LIST='host=localhost,user=root1,port=PORT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
connection default;
SELECT user();
user()
root@localhost
...
...
@@ -24,7 +21,6 @@ a
10
20
30
connection user;
SELECT user();
user()
user@localhost
...
...
@@ -43,12 +39,10 @@ ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
user()
root@localhost
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
connection user;
SELECT user();
user()
user@localhost
...
...
@@ -60,8 +54,6 @@ UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
disconnect user;
connection default;
SELECT user();
user()
root@localhost
...
...
storage/connect/mysql-test/connect/r/mysql_new.result
View file @
0b9ea65d
connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
connection master;
CREATE DATABASE connect;
connection slave;
CREATE DATABASE connect;
connection slave;
CREATE TABLE t1 (a int, b char(10));
INSERT INTO t1 VALUES (NULL,NULL),(0,'test00'),(1,'test01'),(2,'test02'),(3,'test03');
SELECT * FROM t1;
...
...
@@ -17,7 +12,6 @@ NULL NULL
#
# Testing errors
#
connection master;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
CONNECTION='mysql://unknown@127.0.0.1:SLAVE_PORT/test/t1';
ERROR HY000: (1045) Access denied for user 'unknown'@'localhost' (using password: NO)
...
...
@@ -29,7 +23,7 @@ OPTION_LIST='host=127.0.0.1,user=root,port=SLAVE_PORT' DBNAME='unknown' TABNAME=
ERROR HY000: (1049) Unknown database 'unknown'
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/unknown';
ERROR HY000: (1146) Table 'test.unknown' doesn't exist [SHOW FULL COLUMNS FROM
unknown
FROM test]
ERROR HY000: (1146) Table 'test.unknown' doesn't exist [SHOW FULL COLUMNS FROM
`unknown`
FROM test]
SHOW CREATE TABLE t1;
ERROR 42S02: Table 'test.t1' doesn't exist
CREATE TABLE t1 (x int, y char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL
...
...
@@ -45,14 +39,10 @@ ERROR HY000: Got error 174 '(1054) Unknown column 'x' in 'field list' [SELECT `x
DROP TABLE t1;
CREATE TABLE t1 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
connection slave;
ALTER TABLE t1 RENAME t1backup;
connection master;
SELECT * FROM t1;
ERROR HY000: Got error 174 '(1146) Table 'test.t1' doesn't exist [SELECT `a`, `b` FROM `t1`]' from CONNECT
connection slave;
ALTER TABLE t1backup RENAME t1;
connection master;
DROP TABLE t1;
#
# Testing SELECT, etc.
...
...
@@ -121,7 +111,6 @@ NULL NULL
2 0
3 0
DROP TABLE t1;
connection slave;
DROP TABLE t1;
#
# Testing numeric data types
...
...
@@ -140,7 +129,6 @@ t1 CREATE TABLE `t1` (
`h` decimal(20,5) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES(100,3333,41235,1234567890,235000000000,3.14159265,3.14159265,3141.59265);
connection master;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
OPTION_LIST='host=127.0.0.1,user=root,port=SLAVE_PORT';
SHOW CREATE TABLE t1;
...
...
@@ -159,7 +147,6 @@ SELECT * FROM t1;
a b c d e f g h
100 3333 41235 1234567890 235000000000 3.14159 3.14159265 3141.59265
DROP TABLE t1;
connection slave;
DROP TABLE t1;
#
# Testing character data types
...
...
@@ -175,7 +162,6 @@ INSERT INTO t1 VALUES('Welcome','Hello, World');
SELECT * FROM t1;
a b
Welcome Hello, World
connection master;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT';
SHOW CREATE TABLE t1;
...
...
@@ -188,7 +174,6 @@ SELECT * FROM t1;
a b
Welcome Hello, World
DROP TABLE t1;
connection slave;
DROP TABLE t1;
#
# Testing temporal data types
...
...
@@ -200,7 +185,7 @@ t1 CREATE TABLE `t1` (
`a` date DEFAULT NULL,
`b` datetime DEFAULT NULL,
`c` time DEFAULT NULL,
`d` timestamp NOT NULL DEFAULT
current_timestamp() ON UPDATE current_timestamp()
,
`d` timestamp NOT NULL DEFAULT
CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
,
`e` year(4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT IGNORE INTO t1 VALUES('2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23','2003-05-27 10:45:23');
...
...
@@ -211,7 +196,6 @@ Warning 1265 Data truncated for column 'e' at row 1
SELECT * FROM t1;
a b c d e
2003-05-27 2003-05-27 10:45:23 10:45:23 2003-05-27 10:45:23 2003
connection master;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT';
SHOW CREATE TABLE t1;
...
...
@@ -220,18 +204,15 @@ t1 CREATE TABLE `t1` (
`a` date DEFAULT NULL,
`b` datetime DEFAULT NULL,
`c` time DEFAULT NULL,
`d` timestamp NOT NULL DEFAULT
current_timestamp() ON UPDATE current_timestamp()
,
`d` timestamp NOT NULL DEFAULT
CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
,
`e` year(4) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT' `TABLE_TYPE`='MYSQL'
SELECT * FROM t1;
a b c d e
2003-05-27 2003-05-27 10:45:23 10:45:23 2003-05-27 10:45:23 2003
DROP TABLE t1;
connection slave;
DROP TABLE t1;
connection master;
DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect;
connection slave;
DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect;
storage/connect/mysql-test/connect/r/tbl_thread.result
View file @
0b9ea65d
connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
connection master;
CREATE DATABASE connect;
connection slave;
CREATE DATABASE connect;
connection default;
#
# Checking thread TBL tables
#
...
...
@@ -16,7 +11,6 @@ a b
1 test01
2 test02
3 test03
connection master;
CREATE TABLE rt2 (a int, b char(10));
INSERT INTO rt2 VALUES (4,'test04'),(5,'test05'),(6,'test06'),(7,'test07');
SELECT * FROM rt2;
...
...
@@ -25,7 +19,7 @@ a b
5 test05
6 test06
7 test07
connection slave
;
USE test
;
CREATE TABLE rt3 (a int, b char(10));
INSERT INTO rt3 VALUES (8,'test08'),(9,'test09'),(10,'test10'),(11,'test11');
SELECT * FROM rt3;
...
...
@@ -34,7 +28,6 @@ a b
9 test09
10 test10
11 test11
connection default;
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL
CONNECTION='mysql://root@localhost:MASTER_PORT/test/rt2';
SELECT * FROM t2;
...
...
@@ -68,11 +61,8 @@ a b
2 test02
1 test01
0 test00
connection master;
DROP TABLE rt2;
connection slave;
DROP TABLE rt3;
connection default;
DROP TABLE t1,t2,t3,total;
#
# Old thread TBL tables test modified
...
...
@@ -110,9 +100,7 @@ v
DROP TABLE total;
DROP TABLE t1;
DROP TABLE t2;
connection master;
DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect;
connection slave;
DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect;
storage/connect/mysql-test/connect/r/xml_grant.result
View file @
0b9ea65d
...
...
@@ -4,8 +4,6 @@
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
connect user,localhost,user,,;
connection user;
SELECT user();
user()
user@localhost
...
...
@@ -34,13 +32,11 @@ DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=domdoc,rownode=row' FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
connection default;
SELECT user();
user()
root@localhost
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=domdoc,rownode=row' FILE_NAME='t1.EXT';
INSERT INTO t1 VALUES (10);
connection user;
SELECT user();
user()
user@localhost
...
...
@@ -63,12 +59,10 @@ ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
user()
root@localhost
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
connection user;
SELECT user();
user()
user@localhost
...
...
@@ -80,7 +74,6 @@ UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
connection default;
SELECT user();
user()
root@localhost
...
...
@@ -90,15 +83,12 @@ CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmls
Warnings:
Warning 1105 No file name. Table will use t1.xml
INSERT INTO t1 VALUES (10);
connection user;
SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
connection default;
DROP TABLE t1;
disconnect user;
DROP USER user@localhost;
#
# End of grant.inc
...
...
storage/connect/mysql-test/connect/r/xml_mdev5261.result
View file @
0b9ea65d
...
...
@@ -17,7 +17,7 @@ SELECT * FROM t1 WHERE i = 5;
i
5
ALTER TABLE t1 DROP INDEX i;
ERROR 42000: Can't DROP
INDEX `i`; check that it
exists
ERROR 42000: Can't DROP
'i'; check that column/key
exists
DROP INDEX i ON t1;
ERROR 42000: Can't DROP
INDEX `i`; check that it
exists
ERROR 42000: Can't DROP
'i'; check that column/key
exists
DROP TABLE t1;
storage/connect/mysql-test/connect/t/dir.test
View file @
0b9ea65d
...
...
@@ -23,7 +23,9 @@ ALTER TABLE t1 OPTION_LIST='subdir=0';
SHOW
CREATE
TABLE
t1
;
--
replace_result
$MYSQLD_DATADIR
DATADIR
/
SELECT
fname
,
ftype
,
size
FROM
t1
ORDER
BY
fname
,
ftype
,
size
;
--
error
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
# TODO: add a better error message
--
error
ER_GET_ERRMSG
INSERT
INTO
t1
VALUES
(
''
,
''
,
''
,
''
);
DROP
TABLE
t1
;
...
...
storage/connect/mysql-test/connect/t/tbl_thread.test
View file @
0b9ea65d
...
...
@@ -19,6 +19,7 @@ SELECT * FROM rt2;
connection
slave
;
USE
test
;
CREATE
TABLE
rt3
(
a
int
,
b
char
(
10
));
INSERT
INTO
rt3
VALUES
(
8
,
'test08'
),(
9
,
'test09'
),(
10
,
'test10'
),(
11
,
'test11'
);
SELECT
*
FROM
rt3
;
...
...
storage/connect/odbconn.cpp
View file @
0b9ea65d
...
...
@@ -55,6 +55,7 @@ extern "C" HINSTANCE s_hModule; // Saved module handle
TYPCONV
GetTypeConv
();
int
GetConvSize
();
void
OdbcClose
(
PGLOBAL
g
,
PFBLOCK
fp
);
/***********************************************************************/
/* Some macro's (should be defined elsewhere to be more accessible) */
...
...
@@ -301,6 +302,13 @@ static void ResetNullValues(CATPARM *cap)
} // end of ResetNullValues
#endif
/***********************************************************************/
/* Close an ODBC table after a thrown error (called by PlugCloseFile) */
/***********************************************************************/
void
OdbcClose
(
PGLOBAL
g
,
PFBLOCK
fp
)
{
((
ODBConn
*
)
fp
->
File
)
->
Close
();
}
// end of OdbcClose
/***********************************************************************/
/* ODBCColumns: constructs the result blocks containing all columns */
/* of an ODBC table that will be retrieved by GetData commands. */
...
...
storage/connect/os.h
View file @
0b9ea65d
...
...
@@ -46,7 +46,7 @@ typedef int INT;
sqltypes.h (through sql.h or sqlext.h).
*/
typedef
unsigned
long
DWORD
;
#endif
/
* !NODW */
#endif /
/ !NODW
#undef HANDLE
typedef
int
HANDLE
;
...
...
storage/connect/plgdbutl.cpp
View file @
0b9ea65d
...
...
@@ -68,12 +68,6 @@
#include "tabcol.h" // header of XTAB and COLUMN classes
#include "valblk.h"
#include "rcmsg.h"
#if defined(ODBC_SUPPORT)
#define NODW // See comment in os.h
#include "tabext.h"
#include "odbccat.h"
#include "tabodbc.h"
#endif // ODBC_SUPPORT
#ifdef ZIP_SUPPORT
#include "filamzip.h"
#endif // ZIP_SUPPORT
...
...
@@ -120,6 +114,9 @@ void CloseXMLFile(PGLOBAL, PFBLOCK, bool);
#include "libdoc.h"
#endif // LIBXML2_SUPPORT
#ifdef ODBC_SUPPORT
void
OdbcClose
(
PGLOBAL
g
,
PFBLOCK
fp
);
#endif // ODBC_SUPPORT
/***********************************************************************/
/* Routines for file IO with error reporting to g->Message */
...
...
@@ -886,7 +883,7 @@ FILE *PlugReopenFile(PGLOBAL g, PFBLOCK fp, LPCSTR md)
/* Close file routine: the purpose of this routine is to avoid */
/* double closing that freeze the system on some Unix platforms. */
/***********************************************************************/
int
PlugCloseFile
(
PGLOBAL
g
__attribute__
((
unused
))
,
PFBLOCK
fp
,
bool
all
)
int
PlugCloseFile
(
PGLOBAL
g
,
PFBLOCK
fp
,
bool
all
)
{
int
rc
=
0
;
...
...
@@ -937,7 +934,7 @@ int PlugCloseFile(PGLOBAL g __attribute__((unused)), PFBLOCK fp, bool all)
#endif // LIBXML2_SUPPORT
#ifdef ODBC_SUPPORT
case
TYPE_FB_ODBC
:
((
ODBConn
*
)
fp
->
File
)
->
Close
(
);
OdbcClose
(
g
,
fp
);
fp
->
Count
=
0
;
fp
->
File
=
NULL
;
break
;
...
...
storage/connect/reldef.cpp
View file @
0b9ea65d
...
...
@@ -227,10 +227,10 @@ bool TABDEF::Define(PGLOBAL g, PCATLG cat,
{
int
poff
=
0
;
Name
=
(
PSZ
)
name
;
Schema
=
(
PSZ
)
schema
;
Hc
=
((
MYCAT
*
)
cat
)
->
GetHandler
();
Name
=
(
PSZ
)
name
;
Schema
=
(
PSZ
)
Hc
->
GetDBName
(
schema
);
Cat
=
cat
;
Hc
=
((
MYCAT
*
)
cat
)
->
GetHandler
();
Catfunc
=
GetFuncID
(
GetStringCatInfo
(
g
,
"Catfunc"
,
NULL
));
Elemt
=
GetIntCatInfo
(
"Elements"
,
0
);
Multiple
=
GetIntCatInfo
(
"Multiple"
,
0
);
...
...
storage/connect/tabjson.cpp
View file @
0b9ea65d
...
...
@@ -54,8 +54,6 @@
/* External functions. */
/***********************************************************************/
USETEMP
UseTemp
(
void
);
bool
IsNum
(
PSZ
s
);
char
*
NextChr
(
PSZ
s
,
char
sep
);
char
*
GetJsonNull
(
void
);
typedef
struct
_jncol
{
...
...
@@ -500,7 +498,7 @@ JSONDEF::JSONDEF(void)
Sep
=
'.'
;
#if defined(MONGO_SUPPORT)
Uri
=
NULL
;
Collname
=
Schema
=
Options
=
Filter
=
NULL
;
Collname
=
Options
=
Filter
=
NULL
;
Pipe
=
false
;
Driver
=
NULL
;
Version
=
0
;
...
...
@@ -515,7 +513,8 @@ JSONDEF::JSONDEF(void)
/***********************************************************************/
bool
JSONDEF
::
DefineAM
(
PGLOBAL
g
,
LPCSTR
,
int
poff
)
{
Jmode
=
(
JMODE
)
GetIntCatInfo
(
"Jmode"
,
MODE_OBJECT
);
Schema
=
GetStringCatInfo
(
g
,
"DBname"
,
Schema
);
Jmode
=
(
JMODE
)
GetIntCatInfo
(
"Jmode"
,
MODE_OBJECT
);
Objname
=
GetStringCatInfo
(
g
,
"Object"
,
NULL
);
Xcol
=
GetStringCatInfo
(
g
,
"Expand"
,
NULL
);
Pretty
=
GetIntCatInfo
(
"Pretty"
,
2
);
...
...
@@ -528,7 +527,6 @@ bool JSONDEF::DefineAM(PGLOBAL g, LPCSTR, int poff)
Collname
=
GetStringCatInfo
(
g
,
"Name"
,
(
Catfunc
&
(
FNC_TABLE
|
FNC_COL
))
?
NULL
:
Name
);
Collname
=
GetStringCatInfo
(
g
,
"Tabname"
,
Collname
);
Schema
=
GetStringCatInfo
(
g
,
"Dbname"
,
"test"
);
Options
=
GetStringCatInfo
(
g
,
"Colist"
,
NULL
);
Filter
=
GetStringCatInfo
(
g
,
"Filter"
,
NULL
);
Pipe
=
GetBoolCatInfo
(
"Pipeline"
,
false
);
...
...
@@ -1592,18 +1590,20 @@ PVAL JSONCOL::ExpandArray(PGLOBAL g, PJAR arp, int n)
/***********************************************************************/
PVAL
JSONCOL
::
CalculateArray
(
PGLOBAL
g
,
PJAR
arp
,
int
n
)
{
int
i
,
ars
,
nv
=
0
,
nextsame
=
Tjp
->
NextSame
;
bool
err
;
//int i, ars, nv = 0, nextsame = Tjp->NextSame;
int
i
,
nv
=
0
,
nextsame
=
Tjp
->
NextSame
;
bool
err
;
OPVAL
op
=
Nodes
[
n
].
Op
;
PVAL
val
[
2
],
vp
=
Nodes
[
n
].
Valp
;
PJVAL
jvrp
,
jvp
;
JVALUE
jval
;
vp
->
Reset
();
ars
=
MY_MIN
(
Tjp
->
Limit
,
arp
->
size
());
//
ars = MY_MIN(Tjp->Limit, arp->size());
for
(
i
=
0
;
i
<
ars
;
i
++
)
{
jvrp
=
arp
->
GetValue
(
i
);
//for (i = 0; i < ars; i++) {
for
(
i
=
0
;
i
<
arp
->
size
();
i
++
)
{
jvrp
=
arp
->
GetValue
(
i
);
if
(
!
jvrp
->
IsNull
()
||
(
op
==
OP_CNC
&&
GetJsonNull
()))
do
{
if
(
jvrp
->
IsNull
())
{
...
...
@@ -2278,11 +2278,7 @@ void TDBJSON::CloseDB(PGLOBAL g)
TDBJCL
::
TDBJCL
(
PJDEF
tdp
)
:
TDBCAT
(
tdp
)
{
Topt
=
tdp
->
GetTopt
();
#if defined(MONGO_SUPPORT)
Db
=
tdp
->
Schema
;
#else
Db
=
NULL
;
#endif
Dsn
=
tdp
->
Uri
;
}
// end of TDBJCL constructor
...
...
storage/connect/tabjson.h
View file @
0b9ea65d
...
...
@@ -70,7 +70,6 @@ class DllExport JSONDEF : public DOSDEF { /* Table description */
const
char
*
Uri
;
/* MongoDB connection URI */
#if defined(MONGO_SUPPORT)
PCSZ
Collname
;
/* External collection name */
PCSZ
Schema
;
/* External schema (DB) name */
PSZ
Options
;
/* Colist ; Pipe */
PSZ
Filter
;
/* Filter */
PSZ
Driver
;
/* MongoDB Driver (C or JAVA) */
...
...
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