Skip to content

Commit 6dda9e0

Browse files
committed
Same as last 10.0 commit
1 parent b3f9838 commit 6dda9e0

File tree

9 files changed

+57
-60
lines changed

9 files changed

+57
-60
lines changed

storage/connect/global.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ extern "C" {
118118
/* Static variables */
119119
/***********************************************************************/
120120
#if defined(STORAGE)
121-
char sys_stamp[4] = SYS_STAMP;
121+
char sys_stamp[5] = SYS_STAMP;
122122
#else
123123
extern char sys_stamp[];
124124
#endif

storage/connect/ha_connect.cc

Lines changed: 24 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -168,35 +168,21 @@
168168
#define JSONMAX 10 // JSON Default max grp size
169169

170170
extern "C" {
171-
char version[]= "Version 1.03.0006 April 12, 2015";
172-
171+
char version[]= "Version 1.03.0007 April 30, 2015";
173172
#if defined(WIN32)
174-
char compver[]= "Version 1.03.0006 " __DATE__ " " __TIME__;
173+
char compver[]= "Version 1.03.0007 " __DATE__ " " __TIME__;
175174
char slash= '\\';
176175
#else // !WIN32
177176
char slash= '/';
178177
#endif // !WIN32
179-
180-
// int trace= 0; // The general trace value
181-
// ulong xconv= 0; // The type conversion option
182-
// int zconv= 0; // The text conversion size
183178
} // extern "C"
184179

185180
#if defined(XMAP)
186181
my_bool xmap= false;
187182
#endif // XMAP
188183

189-
// uint worksize= 0;
190184
ulong ha_connect::num= 0;
191-
//int DTVAL::Shift= 0;
192185

193-
/* CONNECT system variables */
194-
//atic int conv_size= 0;
195-
//atic uint work_size= 0;
196-
//atic ulong type_conv= 0;
197-
#if defined(XMAP)
198-
//atic my_bool indx_map= 0;
199-
#endif // XMAP
200186
#if defined(XMSG)
201187
extern "C" {
202188
char *msg_path;
@@ -613,9 +599,9 @@ DllExport LPCSTR PlugSetPath(LPSTR to, LPCSTR name, LPCSTR dir)
613599
delete_table method in handler.cc
614600
*/
615601
static const char *ha_connect_exts[]= {
616-
".dos", ".fix", ".csv", ".bin", ".fmt", ".dbf", ".xml", ".ini", ".vec",
617-
".dnx", ".fnx", ".bnx", ".vnx", ".dbx", ".dop", ".fop", ".bop", ".vop",
618-
NULL};
602+
".dos", ".fix", ".csv", ".bin", ".fmt", ".dbf", ".xml", ".json", ".ini",
603+
".vec", ".dnx", ".fnx", ".bnx", ".vnx", ".dbx", ".dop", ".fop", ".bop",
604+
".vop", NULL};
619605

620606
/**
621607
@brief
@@ -4730,6 +4716,25 @@ ha_rows ha_connect::records_in_range(uint inx, key_range *min_key,
47304716
DBUG_RETURN(rows);
47314717
} // end of records_in_range
47324718

4719+
// Used to check whether a MYSQL table is created on itself
4720+
bool CheckSelf(PGLOBAL g, TABLE_SHARE *s, const char *host,
4721+
const char *db, char *tab, const char *src, int port)
4722+
{
4723+
if (src)
4724+
return false;
4725+
else if (host && stricmp(host, "localhost") && strcmp(host, "127.0.0.1"))
4726+
return false;
4727+
else if (db && stricmp(db, s->db.str))
4728+
return false;
4729+
else if (tab && stricmp(tab, s->table_name.str))
4730+
return false;
4731+
else if (port && port != (signed)GetDefaultPort())
4732+
return false;
4733+
4734+
strcpy(g->Message, "This MySQL table is defined on itself");
4735+
return true;
4736+
} // end of CheckSelf
4737+
47334738
/**
47344739
Convert an ISO-8859-1 column name to UTF-8
47354740
*/
@@ -4933,25 +4938,6 @@ static int init_table_share(THD* thd,
49334938
sql->ptr(), sql->length());
49344939
} // end of init_table_share
49354940

4936-
// Used to check whether a MYSQL table is created on itself
4937-
bool CheckSelf(PGLOBAL g, TABLE_SHARE *s, const char *host,
4938-
const char *db, char *tab, const char *src, int port)
4939-
{
4940-
if (src)
4941-
return false;
4942-
else if (host && stricmp(host, "localhost") && strcmp(host, "127.0.0.1"))
4943-
return false;
4944-
else if (db && stricmp(db, s->db.str))
4945-
return false;
4946-
else if (tab && stricmp(tab, s->table_name.str))
4947-
return false;
4948-
else if (port && port != (signed)GetDefaultPort())
4949-
return false;
4950-
4951-
strcpy(g->Message, "This MySQL table is defined on itself");
4952-
return true;
4953-
} // end of CheckSelf
4954-
49554941
/**
49564942
@brief
49574943
connect_assisted_discovery() is called when creating a table with no columns.

storage/connect/mysql-test/connect/r/json.result

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ ISBN Language Subject AuthorFN AuthorLN Title Translation Translator Publisher L
8989
UPDATE t1 SET AuthorFN = 'Philippe' WHERE AuthorLN = 'Knab';
9090
SELECT * FROM t1 WHERE ISBN = '9782212090819';
9191
ISBN Language Subject AuthorFN AuthorLN Title Translation Translator Publisher Location Year
92-
9782212090819 fr applications Philippe Bernadac Construire une application XML NULL NULL Eyrolles Paris 1999
93-
9782212090819 fr applications Fran�ois Knab Construire une application XML NULL NULL Eyrolles Paris 1999
92+
9782212090819 fr applications Jean-Christophe Bernadac Construire une application XML NULL NULL Eyrolles Paris 1999
93+
9782212090819 fr applications Philippe Knab Construire une application XML NULL NULL Eyrolles Paris 1999
9494
#
9595
# To add an author a new table must be created
9696
#
@@ -104,8 +104,8 @@ William J. Pardi
104104
INSERT INTO t2 VALUES('Charles','Dickens');
105105
SELECT * FROM t1;
106106
ISBN Language Subject AuthorFN AuthorLN Title Translation Translator Publisher Location Year
107-
9782212090819 fr applications Philippe Bernadac Construire une application XML NULL NULL Eyrolles Paris 1999
108-
9782212090819 fr applications Fran�ois Knab Construire une application XML NULL NULL Eyrolles Paris 1999
107+
9782212090819 fr applications Jean-Christophe Bernadac Construire une application XML NULL NULL Eyrolles Paris 1999
108+
9782212090819 fr applications Philippe Knab Construire une application XML NULL NULL Eyrolles Paris 1999
109109
9782840825685 fr applications William J. Pardi XML en Action adapt� de l'anglais par James Guerin Microsoft Press Paris 1999
110110
9782840825685 fr applications Charles Dickens XML en Action adapt� de l'anglais par James Guerin Microsoft Press Paris 1999
111111
DROP TABLE t1;
@@ -127,11 +127,11 @@ line
127127
"SUBJECT": "applications",
128128
"AUTHOR": [
129129
{
130-
"FIRSTNAME": "Philippe",
130+
"FIRSTNAME": "Jean-Christophe",
131131
"LASTNAME": "Bernadac"
132132
},
133133
{
134-
"FIRSTNAME": "Fran�ois",
134+
"FIRSTNAME": "Philippe",
135135
"LASTNAME": "Knab"
136136
}
137137
],

storage/connect/tabjson.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,20 @@ bool JSONCOL::ParseJpath(PGLOBAL g)
968968
else if (!Jpath)
969969
Jpath = Name;
970970

971+
if (To_Tdb->GetOrig()) {
972+
// This is an updated column, get nodes from origin
973+
for (PJCOL colp = (PJCOL)Tjp->GetColumns(); colp;
974+
colp = (PJCOL)colp->GetNext())
975+
if (!stricmp(Name, colp->GetName())) {
976+
Nod = colp->Nod;
977+
Nodes = colp->Nodes;
978+
goto fin;
979+
} // endif Name
980+
981+
sprintf(g->Message, "Cannot parse updated column %s", Name);
982+
return true;
983+
} // endif To_Orig
984+
971985
pbuf = PlugDup(g, Jpath);
972986

973987
// The Jpath must be analyzed
@@ -998,6 +1012,7 @@ bool JSONCOL::ParseJpath(PGLOBAL g)
9981012

9991013
} // endfor i, p
10001014

1015+
fin:
10011016
MulVal = AllocateValue(g, Value);
10021017
Parsed = true;
10031018
return false;
@@ -1147,7 +1162,7 @@ PVAL JSONCOL::ExpandArray(PGLOBAL g, PJAR arp, int n)
11471162

11481163
ars = MY_MIN(Tjp->Limit, arp->size());
11491164

1150-
if (!(jvp = arp->GetValue(Nodes[n].Nx))) {
1165+
if (!(jvp = arp->GetValue((Nodes[n].Rx = Nodes[n].Nx)))) {
11511166
strcpy(g->Message, "Logical error expanding array");
11521167
longjmp(g->jumper[g->jump_level], 666);
11531168
} // endif jvp
@@ -1278,7 +1293,7 @@ PJSON JSONCOL::GetRow(PGLOBAL g)
12781293
if (Nodes[i].Rank)
12791294
val = arp->GetValue(Nodes[i].Rank - 1);
12801295
else
1281-
val = arp->GetValue(Nodes[i].Nx);
1296+
val = arp->GetValue(Nodes[i].Rx);
12821297

12831298
} else
12841299
val = NULL;
@@ -1726,7 +1741,7 @@ bool TDBJSON::OpenDB(PGLOBAL g)
17261741
/***********************************************************************/
17271742
int TDBJSON::ReadDB(PGLOBAL g)
17281743
{
1729-
int rc;
1744+
int rc;
17301745

17311746
N++;
17321747

storage/connect/tabjson.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ typedef struct _jnode {
2525
PVAL CncVal; // To cont value used for OP_CNC
2626
PVAL Valp; // The internal array VALUE
2727
int Rank; // The rank in array
28-
int Nx; // Same row number
28+
int Rx; // Read row number
29+
int Nx; // Next to read row number
2930
} JNODE, *PJNODE;
3031

3132
/***********************************************************************/

storage/connect/tabmul.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,10 @@ bool TDBMUL::InitFileNames(PGLOBAL g)
171171
} // endif hSearch
172172

173173
while (n < PFNZ) {
174-
strcat(strcat(strcpy(filename, drive), direc), FileData.cFileName);
175-
pfn[n++] = PlugDup(g, filename);
174+
if (!(FileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
175+
strcat(strcat(strcpy(filename, drive), direc), FileData.cFileName);
176+
pfn[n++] = PlugDup(g, filename);
177+
} // endif dwFileAttributes
176178

177179
if (!FindNextFile(hSearch, &FileData)) {
178180
rc = GetLastError();

storage/connect/tabtbl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* COPYRIGHT: */
77
/* ---------- */
8-
/* (C) Copyright to PlugDB Software Development 2008-2014 */
8+
/* (C) Copyright to PlugDB Software Development 2008-2015 */
99
/* Author: Olivier BERTRAND */
1010
/* */
1111
/* WHAT THIS PROGRAM DOES: */

storage/connect/tabutil.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
#include "tabutil.h"
5353
#include "ha_connect.h"
5454

55-
//extern "C" int zconv;
5655
int GetConvSize(void);
5756

5857
/************************************************************************/
@@ -72,11 +71,8 @@ TABLE_SHARE *GetTableShare(PGLOBAL g, THD *thd, const char *db,
7271
{
7372
char key[256];
7473
uint k;
75-
//TABLE_LIST table_list;
7674
TABLE_SHARE *s;
7775

78-
//table_list.init_one_table(db, strlen(db), name, strlen(name),
79-
// NULL, TL_IGNORE);
8076
k = sprintf(key, "%s", db) + 1;
8177
k += sprintf(key + k, "%s", name);
8278
key[++k] = 0;
@@ -86,9 +82,6 @@ TABLE_SHARE *GetTableShare(PGLOBAL g, THD *thd, const char *db,
8682
return NULL;
8783
} // endif s
8884

89-
// 1 2 4 8
90-
//flags = GTS_TABLE | GTS_VIEW | GTS_NOLOCK | GTS_FORCE_DISCOVERY;
91-
9285
if (!open_table_def(thd, s, GTS_TABLE | GTS_VIEW)) {
9386
if (!s->is_view) {
9487
if (stricmp(plugin_name(s->db_plugin)->str, "connect"))

storage/connect/value.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/************* Value C++ Functions Source Code File (.CPP) *************/
22
/* Name: VALUE.CPP Version 2.5 */
33
/* */
4-
/* (C) Copyright to the author Olivier BERTRAND 2001-2014 */
4+
/* (C) Copyright to the author Olivier BERTRAND 2001-2015 */
55
/* */
66
/* This file contains the VALUE and derived classes family functions. */
77
/* These classes contain values of different types. They are used so */

0 commit comments

Comments
 (0)