Commit 9e48a920 authored by Otto Kekäläinen's avatar Otto Kekäläinen

Imported Upstream version 10.0.19

parent 17d544d3
......@@ -4,15 +4,16 @@
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.ic text
*.cc text
*.cpp text
*.h text
*.test text
# Declare files that will always have LF line endings on checkout.
*.result text eol=lf
storage/connect/mysql-test/connect/std_data/*.txt text eol=lf
storage/connect/mysql-test/connect/std_data/*.dat text eol=lf
# These files should be checked out as is
*.result -text -whitespace
storage/connect/mysql-test/connect/std_data/*.txt -text
storage/connect/mysql-test/connect/std_data/*.dat -text
# Denote all files that are truly binary and should not be modified.
*.png binary
......
commit: 5c833689ac98991ea85a1a50565e2b1a6abe6c1f
date: 2015-05-06 12:41:21 +0200
build-date: 2015-05-06 12:49:07 +0200
short: 5c83368
commit: 0880284bf715b4916cc735e19b76d1062c2bfdcf
date: 2015-05-08 17:06:35 +0300
build-date: 2015-05-08 16:37:53 +0200
short: 0880284
branch: HEAD
MySQL source 10.0.18
MySQL source 10.0.19
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=0
MYSQL_VERSION_PATCH=18
MYSQL_VERSION_PATCH=19
......@@ -207,3 +207,10 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
create table t1 (a blob);
create view v1 as select * from t1;
repair view v1;
Table Op Msg_type Msg_text
test.v1 repair status OK
drop view v1;
drop table t1;
......@@ -210,3 +210,12 @@ repair table t1 use_frm;
select count(*) from t1;
check table t1;
drop table t1;
#
# MDEV-8115 mysql_upgrade crashes the server with REPAIR VIEW
#
create table t1 (a blob);
create view v1 as select * from t1;
repair view v1;
drop view v1;
drop table t1;
......@@ -1012,7 +1012,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
break;
}
}
if (table->table)
if (table->table && !table->view)
{
if (table->table->s->tmp_table)
{
......
This diff is collapsed.
......@@ -74,16 +74,28 @@ typedef struct _dbfheader {
//uchar Dbfox :4; /* FoxPro if equal to 3 */
uchar Version; /* Version information flags */
char Filedate[3]; /* date, YYMMDD, binary. YY=year-1900 */
uint Records; /* records in the file */
ushort Headlen; /* bytes in the header */
ushort Reclen; /* bytes in a record */
ushort Fields; /* Reserved but used to store fields */
private:
/* The following four members are stored in little-endian format on disk */
char m_RecordsBuf[4]; /* records in the file */
char m_HeadlenBuf[2]; /* bytes in the header */
char m_ReclenBuf[2]; /* bytes in a record */
char m_FieldsBuf[2]; /* Reserved but used to store fields */
public:
char Incompleteflag; /* 01 if incomplete, else 00 */
char Encryptflag; /* 01 if encrypted, else 00 */
char Reserved2[12]; /* for LAN use */
char Mdxflag; /* 01 if production .mdx, else 00 */
char Language; /* Codepage */
char Reserved3[2];
uint Records() const { return uint4korr(m_RecordsBuf); }
ushort Headlen() const { return uint2korr(m_HeadlenBuf); }
ushort Reclen() const { return uint2korr(m_ReclenBuf); }
ushort Fields() const { return uint2korr(m_FieldsBuf); }
void SetHeadlen(ushort num) { int2store(m_HeadlenBuf, num); }
void SetReclen(ushort num) { int2store(m_ReclenBuf, num); }
void SetFields(ushort num) { int2store(m_FieldsBuf, num); }
} DBFHEADER;
/****************************************************************************/
......@@ -143,7 +155,7 @@ static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf)
strcpy(g->Message, MSG(DBASE_FILE));
// Check last byte(s) of header
if (fseek(file, buf->Headlen - dbc, SEEK_SET) != 0) {
if (fseek(file, buf->Headlen() - dbc, SEEK_SET) != 0) {
sprintf(g->Message, MSG(BAD_HEADER), fn);
return RC_FX;
} // endif fseek
......@@ -163,7 +175,7 @@ static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf)
} // endif endmark
// Calculate here the number of fields while we have the dbc info
buf->Fields = (buf->Headlen - dbc - 1) / 32;
buf->SetFields((buf->Headlen() - dbc - 1) / 32);
fseek(file, HEADLEN, SEEK_SET);
return rc;
} // end of dbfhead
......@@ -219,7 +231,7 @@ PQRYRES DBFColumns(PGLOBAL g, char *dp, const char *fn, bool info)
/************************************************************************/
/* Allocate the structures used to refer to the result set. */
/************************************************************************/
fields = mainhead.Fields;
fields = mainhead.Fields();
} else
fields = 0;
......@@ -236,11 +248,11 @@ PQRYRES DBFColumns(PGLOBAL g, char *dp, const char *fn, bool info)
if (trace) {
htrc("Structure of %s\n", filename);
htrc("headlen=%hd reclen=%hd degree=%d\n",
mainhead.Headlen, mainhead.Reclen, fields);
mainhead.Headlen(), mainhead.Reclen(), fields);
htrc("flags(iem)=%d,%d,%d cp=%d\n", mainhead.Incompleteflag,
mainhead.Encryptflag, mainhead.Mdxflag, mainhead.Language);
htrc("%hd records, last changed %02d/%02d/%d\n",
mainhead.Records, mainhead.Filedate[1], mainhead.Filedate[2],
mainhead.Records(), mainhead.Filedate[1], mainhead.Filedate[2],
mainhead.Filedate[0] + (mainhead.Filedate[0] <= 30) ? 2000 : 1900);
htrc("Field Type Offset Len Dec Set Mdx\n");
} // endif trace
......@@ -398,13 +410,13 @@ int DBFBASE::ScanHeader(PGLOBAL g, PSZ fname, int lrecl, char *defpath)
} else if (rc == RC_FX)
return -1;
if ((int)header.Reclen != lrecl) {
sprintf(g->Message, MSG(BAD_LRECL), lrecl, header.Reclen);
if ((int) header.Reclen() != lrecl) {
sprintf(g->Message, MSG(BAD_LRECL), lrecl, header.Reclen());
return -1;
} // endif Lrecl
Records = (int)header.Records;
return (int)header.Headlen;
Records = (int) header.Records();
return (int) header.Headlen();
} // end of ScanHeader
/* ---------------------------- Class DBFFAM ------------------------------ */
......@@ -565,8 +577,8 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g)
header->Filedate[0] = datm->tm_year - 100;
header->Filedate[1] = datm->tm_mon + 1;
header->Filedate[2] = datm->tm_mday;
header->Headlen = (ushort)hlen;
header->Reclen = (ushort)reclen;
header->SetHeadlen((ushort) hlen);
header->SetReclen((ushort) reclen);
descp = (DESCRIPTOR*)header;
// Currently only standard Xbase types are supported
......@@ -627,13 +639,13 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g)
DBFHEADER header;
if ((rc = dbfhead(g, Stream, Tdbp->GetFile(g), &header)) == RC_OK) {
if (Lrecl != (int)header.Reclen) {
sprintf(g->Message, MSG(BAD_LRECL), Lrecl, header.Reclen);
if (Lrecl != (int) header.Reclen()) {
sprintf(g->Message, MSG(BAD_LRECL), Lrecl, header.Reclen());
return true;
} // endif Lrecl
Records = (int)header.Records;
Headlen = (int)header.Headlen;
Records = (int) header.Records();
Headlen = (int) header.Headlen();
} else if (rc == RC_NF) {
Records = 0;
Headlen = 0;
......@@ -868,8 +880,10 @@ void DBFFAM::CloseTableFile(PGLOBAL g, bool abort)
PlugSetPath(filename, To_File, Tdbp->GetPath());
if ((Stream= global_fopen(g, MSGID_OPEN_MODE_STRERROR, filename, "r+b")))
{
char nRecords[4];
int4store(&nRecords, n);
fseek(Stream, 4, SEEK_SET); // Get header.Records position
fwrite(&n, sizeof(int), 1, Stream);
fwrite(&nRecords, sizeof(nRecords), 1, Stream);
fclose(Stream);
Stream= NULL;
Records= n; // Update Records value
......@@ -944,13 +958,13 @@ bool DBMFAM::AllocateBuffer(PGLOBAL g)
/************************************************************************/
DBFHEADER *hp = (DBFHEADER*)Memory;
if (Lrecl != (int)hp->Reclen) {
sprintf(g->Message, MSG(BAD_LRECL), Lrecl, hp->Reclen);
if (Lrecl != (int) hp->Reclen()) {
sprintf(g->Message, MSG(BAD_LRECL), Lrecl, hp->Reclen());
return true;
} // endif Lrecl
Records = (int)hp->Records;
Headlen = (int)hp->Headlen;
Records = (int) hp->Records();
Headlen = (int) hp->Headlen();
} // endif Headlen
/**************************************************************************/
......
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
!include include/default_client.cnf
[mysqld.1]
#log-bin= master-bin
[mysqld.2]
[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket
SLAVE_MYPORT= @mysqld.2.port
SLAVE_MYSOCK= @mysqld.2.socket
PGCLIENTENCODING= UTF8
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
!include include/default_client.cnf
[mysqld.1]
#log-bin= master-bin
[mysqld.2]
[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket
SLAVE_MYPORT= @mysqld.2.port
SLAVE_MYSOCK= @mysqld.2.socket
PGCLIENTENCODING= UTF8
[
{
"ISBN": "9782212090819",
"LANG": "fr",
"SUBJECT": "applications",
"AUTHOR": [
{
"FIRSTNAME": "Jean-Christophe",
"LASTNAME": "Bernadac"
},
{
"FIRSTNAME": "François",
"LASTNAME": "Knab"
}
],
"TITLE": "Construire une application XML",
"PUBLISHER": {
"NAME": "Eyrolles",
"PLACE": "Paris"
},
"DATEPUB": 1999
},
{
"ISBN": "9782840825685",
"LANG": "fr",
"SUBJECT": "applications",
"AUTHOR": [
{
"FIRSTNAME": "William J.",
"LASTNAME": "Pardi"
}
],
"TITLE": "XML en Action",
"TRANSLATION": "adapté de l'anglais par",
"TRANSLATOR": {
"FIRSTNAME": "James",
"LASTNAME": "Guerin"
},
"PUBLISHER": {
"NAME": "Microsoft Press",
"PLACE": "Paris"
},
"DATEPUB": 1999
}
]
[
{
"ISBN": "9782212090819",
"LANG": "fr",
"SUBJECT": "applications",
"AUTHOR": [
{
"FIRSTNAME": "Jean-Christophe",
"LASTNAME": "Bernadac"
},
{
"FIRSTNAME": "François",
"LASTNAME": "Knab"
}
],
"TITLE": "Construire une application XML",
"PUBLISHER": {
"NAME": "Eyrolles",
"PLACE": "Paris"
},
"DATEPUB": 1999
},
{
"ISBN": "9782840825685",
"LANG": "fr",
"SUBJECT": "applications",
"AUTHOR": [
{
"FIRSTNAME": "William J.",
"LASTNAME": "Pardi"
}
],
"TITLE": "XML en Action",
"TRANSLATION": "adapté de l'anglais par",
"TRANSLATOR": {
"FIRSTNAME": "James",
"LASTNAME": "Guerin"
},
"PUBLISHER": {
"NAME": "Microsoft Press",
"PLACE": "Paris"
},
"DATEPUB": 1999
}
]
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="WEB">
<title lang="en">XQuery Kick Start</title>
<author>James McGovern</author>
<author>Per Bothner</author>
<author>Kurt Cagle</author>
<author>James Linn</author>
<author>Vaidyanathan Nagarajan</author>
<year>2003</year>
<price>49.99</price>
</book>
<book category="WEB">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="WEB">
<title lang="en">XQuery Kick Start</title>
<author>James McGovern</author>
<author>Per Bothner</author>
<author>Kurt Cagle</author>
<author>James Linn</author>
<author>Vaidyanathan Nagarajan</author>
<year>2003</year>
<price>49.99</price>
</book>
<book category="WEB">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
[
{
"WHO": "Joe",
"WEEK": [
{
"NUMBER": 3,
"EXPENSE": [
{
"WHAT": "Beer",
"AMOUNT": 18.00
},
{
"WHAT": "Food",
"AMOUNT": 12.00
},
{
"WHAT": "Food",
"AMOUNT": 19.00
},
{
"WHAT": "Car",
"AMOUNT": 20.00
}
]
},
{
"NUMBER": 4,
"EXPENSE": [
{
"WHAT": "Beer",
"AMOUNT": 19.00
},
{
"WHAT": "Beer",
"AMOUNT": 16.00
},
{
"WHAT": "Food",
"AMOUNT": 17.00
},
{
"WHAT": "Food",
"AMOUNT": 17.00
},
{
"WHAT": "Beer",
"AMOUNT": 14.00
}
]
},
{
"NUMBER": 5,
"EXPENSE": [
{
"WHAT": "Beer",
"AMOUNT": 14.00
},
{
"WHAT": "Food",
"AMOUNT": 12.00
}
]
}
]
},
{
"WHO": "Beth",
"WEEK": [
{
"NUMBER": 3,
"EXPENSE": [
{
"WHAT": "Beer",
"AMOUNT": 16.00
}
]
},
{
"NUMBER": 4,
"EXPENSE": [
{
"WHAT": "Food",
"AMOUNT": 17.00
},
{
"WHAT": "Beer",
"AMOUNT": 15.00
}
]
},
{
"NUMBER": 5,
"EXPENSE": [
{
"WHAT": "Food",
"AMOUNT": 12.00
},
{
"WHAT": "Beer",
"AMOUNT": 20.00
}
]
}
]
},
{
"WHO": "Janet",
"WEEK": [
{
"NUMBER": 3,
"EXPENSE": [
{
"WHAT": "Car",
"AMOUNT": 19.00
},
{
"WHAT": "Food",
"AMOUNT": 18.00
},
{
"WHAT": "Beer",
"AMOUNT": 18.00
}
]
},
{
"NUMBER": 4,
"EXPENSE": [
{
"WHAT": "Car",
"AMOUNT": 17.00
}
]
},
{
"NUMBER": 5,
"EXPENSE": [
{
"WHAT": "Beer",
"AMOUNT": 14.00
},
{
"WHAT": "Car",
"AMOUNT": 12.00
},
{
"WHAT": "Beer",
"AMOUNT": 19.00
},
{
"WHAT": "Food",
"AMOUNT": 12.00
}
]
}
]
}
]
[
{
"WHO": "Joe",
"WEEK": [
{
"NUMBER": 3,
"EXPENSE": [
{
"WHAT": "Beer",
"AMOUNT": 18.00
},
{
"WHAT": "Food",
"AMOUNT": 12.00
},
{
"WHAT": "Food",
"AMOUNT": 19.00
},
{
"WHAT": "Car",
"AMOUNT": 20.00
}
]
},
{
"NUMBER": 4,
"EXPENSE": [
{
"WHAT": "Beer",
"AMOUNT": 19.00
},
{
"WHAT": "Beer",
"AMOUNT": 16.00
},
{
"WHAT": "Food",
"AMOUNT": 17.00
},
{
"WHAT": "Food",
"AMOUNT": 17.00
},