mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
- FIX some MAP and XMAP errors (such as mapped indexes not closed)
Do not put version in XML files header Remove HTON_NO_PARTITION for testing Fix a wrong return (instead of DBUG_RETURN) in index_init Plus a few typos modified: storage/connect/connect.cc storage/connect/filter.cpp storage/connect/ha_connect.cc storage/connect/maputil.cpp storage/connect/mysql-test/connect/r/alter_xml.result storage/connect/mysql-test/connect/r/xml.result storage/connect/table.cpp storage/connect/tabxml.cpp storage/connect/xindex.cpp storage/connect/xindex.h storage/connect/xtable.h
This commit is contained in:
@@ -439,10 +439,10 @@ RCODE CntReadNext(PGLOBAL g, PTDB tdbp)
|
|||||||
// Reading sequencially an indexed table. This happens after the
|
// Reading sequencially an indexed table. This happens after the
|
||||||
// handler function records_in_range was called and MySQL decides
|
// handler function records_in_range was called and MySQL decides
|
||||||
// to quit using the index (!!!) Drop the index.
|
// to quit using the index (!!!) Drop the index.
|
||||||
for (PCOL colp= tdbp->GetColumns(); colp; colp= colp->GetNext())
|
// for (PCOL colp= tdbp->GetColumns(); colp; colp= colp->GetNext())
|
||||||
colp->SetKcol(NULL);
|
// colp->SetKcol(NULL);
|
||||||
|
|
||||||
((PTDBASE)tdbp)->SetKindex(g, NULL);
|
((PTDBASE)tdbp)->ResetKindex(g, NULL);
|
||||||
} // endif index
|
} // endif index
|
||||||
|
|
||||||
// Save stack and allocation environment and prepare error return
|
// Save stack and allocation environment and prepare error return
|
||||||
@@ -456,7 +456,12 @@ RCODE CntReadNext(PGLOBAL g, PTDB tdbp)
|
|||||||
goto err;
|
goto err;
|
||||||
} // endif rc
|
} // endif rc
|
||||||
|
|
||||||
while ((rc= (RCODE)tdbp->ReadDB(g)) == RC_NF) ;
|
do {
|
||||||
|
if ((rc= (RCODE)tdbp->ReadDB(g)) == RC_OK)
|
||||||
|
if (!ApplyFilter(g, tdbp->GetFilter()))
|
||||||
|
rc= RC_NF;
|
||||||
|
|
||||||
|
} while (rc == RC_NF);
|
||||||
|
|
||||||
err:
|
err:
|
||||||
g->jump_level--;
|
g->jump_level--;
|
||||||
@@ -585,7 +590,7 @@ int CntCloseTable(PGLOBAL g, PTDB tdbp)
|
|||||||
|
|
||||||
// Make all the eventual indexes
|
// Make all the eventual indexes
|
||||||
tbxp= (TDBDOX*)tdbp;
|
tbxp= (TDBDOX*)tdbp;
|
||||||
tbxp->SetKindex(g, NULL);
|
tbxp->ResetKindex(g, NULL);
|
||||||
tbxp->To_Key_Col= NULL;
|
tbxp->To_Key_Col= NULL;
|
||||||
rc= tbxp->ResetTableOpt(g, true,
|
rc= tbxp->ResetTableOpt(g, true,
|
||||||
((PTDBASE)tdbp)->GetDef()->Indexable() == 1);
|
((PTDBASE)tdbp)->GetDef()->Indexable() == 1);
|
||||||
|
@@ -1725,7 +1725,7 @@ DllExport bool ApplyFilter(PGLOBAL g, PFIL filp)
|
|||||||
if (filp->Eval(g))
|
if (filp->Eval(g))
|
||||||
longjmp(g->jumper[g->jump_level], TYPE_FILTER);
|
longjmp(g->jumper[g->jump_level], TYPE_FILTER);
|
||||||
|
|
||||||
if (trace)
|
if (trace > 1)
|
||||||
htrc("PlugFilter filp=%p result=%d\n",
|
htrc("PlugFilter filp=%p result=%d\n",
|
||||||
filp, filp->GetResult());
|
filp, filp->GetResult());
|
||||||
|
|
||||||
|
@@ -170,7 +170,8 @@
|
|||||||
#define SZWMIN 4194304 // Minimum work area size 4M
|
#define SZWMIN 4194304 // Minimum work area size 4M
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
char version[]= "Version 1.03.0002 April 23, 2014";
|
char version[]= "Version 1.03.0002 May 03, 2014";
|
||||||
|
char compver[]= "Version 1.03.0002 " __DATE__ " " __TIME__;
|
||||||
|
|
||||||
#if defined(XMSG)
|
#if defined(XMSG)
|
||||||
char msglang[]; // Default message language
|
char msglang[]; // Default message language
|
||||||
@@ -420,7 +421,7 @@ static int connect_init_func(void *p)
|
|||||||
{
|
{
|
||||||
DBUG_ENTER("connect_init_func");
|
DBUG_ENTER("connect_init_func");
|
||||||
|
|
||||||
sql_print_information("CONNECT: %s", version);
|
sql_print_information("CONNECT: %s", compver);
|
||||||
|
|
||||||
// xtrace is now a system variable
|
// xtrace is now a system variable
|
||||||
trace= xtrace;
|
trace= xtrace;
|
||||||
@@ -432,9 +433,10 @@ static int connect_init_func(void *p)
|
|||||||
init_connect_psi_keys();
|
init_connect_psi_keys();
|
||||||
|
|
||||||
connect_hton= (handlerton *)p;
|
connect_hton= (handlerton *)p;
|
||||||
connect_hton->state= SHOW_OPTION_YES;
|
connect_hton->state= SHOW_OPTION_YES;
|
||||||
connect_hton->create= connect_create_handler;
|
connect_hton->create= connect_create_handler;
|
||||||
connect_hton->flags= HTON_TEMPORARY_NOT_SUPPORTED | HTON_NO_PARTITION;
|
//connect_hton->flags= HTON_TEMPORARY_NOT_SUPPORTED | HTON_NO_PARTITION;
|
||||||
|
connect_hton->flags= HTON_TEMPORARY_NOT_SUPPORTED;
|
||||||
connect_hton->table_options= connect_table_option_list;
|
connect_hton->table_options= connect_table_option_list;
|
||||||
connect_hton->field_options= connect_field_option_list;
|
connect_hton->field_options= connect_field_option_list;
|
||||||
connect_hton->index_options= connect_index_option_list;
|
connect_hton->index_options= connect_index_option_list;
|
||||||
@@ -446,7 +448,7 @@ static int connect_init_func(void *p)
|
|||||||
|
|
||||||
DTVAL::SetTimeShift(); // Initialize time zone shift once for all
|
DTVAL::SetTimeShift(); // Initialize time zone shift once for all
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
} // end of connect_init_func
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -476,13 +478,13 @@ static int connect_done_func(void *p)
|
|||||||
} // endfor pc
|
} // endfor pc
|
||||||
|
|
||||||
DBUG_RETURN(error);
|
DBUG_RETURN(error);
|
||||||
}
|
} // end of connect_done_func
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief
|
@brief
|
||||||
Example of simple lock controls. The "share" it creates is a
|
Example of simple lock controls. The "share" it creates is a
|
||||||
structure we will pass to each example handler. Do you have to have
|
structure we will pass to each CONNECT handler. Do you have to have
|
||||||
one of these? Well, you have pieces that are used for locking, and
|
one of these? Well, you have pieces that are used for locking, and
|
||||||
they are needed to function.
|
they are needed to function.
|
||||||
*/
|
*/
|
||||||
@@ -490,20 +492,22 @@ static int connect_done_func(void *p)
|
|||||||
CONNECT_SHARE *ha_connect::get_share()
|
CONNECT_SHARE *ha_connect::get_share()
|
||||||
{
|
{
|
||||||
CONNECT_SHARE *tmp_share;
|
CONNECT_SHARE *tmp_share;
|
||||||
|
|
||||||
lock_shared_ha_data();
|
lock_shared_ha_data();
|
||||||
if (!(tmp_share= static_cast<CONNECT_SHARE*>(get_ha_share_ptr())))
|
|
||||||
{
|
if (!(tmp_share= static_cast<CONNECT_SHARE*>(get_ha_share_ptr()))) {
|
||||||
tmp_share= new CONNECT_SHARE;
|
tmp_share= new CONNECT_SHARE;
|
||||||
if (!tmp_share)
|
if (!tmp_share)
|
||||||
goto err;
|
goto err;
|
||||||
mysql_mutex_init(con_key_mutex_CONNECT_SHARE_mutex,
|
mysql_mutex_init(con_key_mutex_CONNECT_SHARE_mutex,
|
||||||
&tmp_share->mutex, MY_MUTEX_INIT_FAST);
|
&tmp_share->mutex, MY_MUTEX_INIT_FAST);
|
||||||
set_ha_share_ptr(static_cast<Handler_share*>(tmp_share));
|
set_ha_share_ptr(static_cast<Handler_share*>(tmp_share));
|
||||||
}
|
} // endif tmp_share
|
||||||
err:
|
|
||||||
|
err:
|
||||||
unlock_shared_ha_data();
|
unlock_shared_ha_data();
|
||||||
return tmp_share;
|
return tmp_share;
|
||||||
}
|
} // end of get_share
|
||||||
|
|
||||||
|
|
||||||
static handler* connect_create_handler(handlerton *hton,
|
static handler* connect_create_handler(handlerton *hton,
|
||||||
@@ -740,7 +744,7 @@ ulonglong ha_connect::table_flags() const
|
|||||||
} // end of table_flags
|
} // end of table_flags
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
/* Return the value of an option specified in the option list. */
|
/* Return the value of an option specified in an option list. */
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
char *GetListOption(PGLOBAL g, const char *opname,
|
char *GetListOption(PGLOBAL g, const char *opname,
|
||||||
const char *oplist, const char *def)
|
const char *oplist, const char *def)
|
||||||
@@ -2717,7 +2721,7 @@ int ha_connect::index_init(uint idx, bool sorted)
|
|||||||
} // endif index type
|
} // endif index type
|
||||||
|
|
||||||
if ((rc= rnd_init(0)))
|
if ((rc= rnd_init(0)))
|
||||||
return rc;
|
DBUG_RETURN(rc);
|
||||||
|
|
||||||
if (locked == 2) {
|
if (locked == 2) {
|
||||||
// Indexes are not updated in lock write mode
|
// Indexes are not updated in lock write mode
|
||||||
@@ -3133,6 +3137,10 @@ void ha_connect::position(const uchar *record)
|
|||||||
DBUG_ENTER("ha_connect::position");
|
DBUG_ENTER("ha_connect::position");
|
||||||
//if (((PTDBASE)tdbp)->GetDef()->Indexable())
|
//if (((PTDBASE)tdbp)->GetDef()->Indexable())
|
||||||
my_store_ptr(ref, ref_length, (my_off_t)((PTDBASE)tdbp)->GetRecpos());
|
my_store_ptr(ref, ref_length, (my_off_t)((PTDBASE)tdbp)->GetRecpos());
|
||||||
|
|
||||||
|
if (trace)
|
||||||
|
htrc("position: pos=%d\n", ((PTDBASE)tdbp)->GetRecpos());
|
||||||
|
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
} // end of position
|
} // end of position
|
||||||
|
|
||||||
@@ -3159,9 +3167,13 @@ int ha_connect::rnd_pos(uchar *buf, uchar *pos)
|
|||||||
PTDBASE tp= (PTDBASE)tdbp;
|
PTDBASE tp= (PTDBASE)tdbp;
|
||||||
DBUG_ENTER("ha_connect::rnd_pos");
|
DBUG_ENTER("ha_connect::rnd_pos");
|
||||||
|
|
||||||
if (!tp->SetRecpos(xp->g, (int)my_get_ptr(pos, ref_length)))
|
if (!tp->SetRecpos(xp->g, (int)my_get_ptr(pos, ref_length))) {
|
||||||
|
if (trace)
|
||||||
|
htrc("rnd_pos: %d\n", tp->GetRecpos());
|
||||||
|
|
||||||
|
tp->SetFilter(NULL);
|
||||||
rc= rnd_next(buf);
|
rc= rnd_next(buf);
|
||||||
else
|
} else
|
||||||
rc= HA_ERR_KEY_NOT_FOUND;
|
rc= HA_ERR_KEY_NOT_FOUND;
|
||||||
|
|
||||||
DBUG_RETURN(rc);
|
DBUG_RETURN(rc);
|
||||||
@@ -4085,7 +4097,8 @@ ha_rows ha_connect::records_in_range(uint inx, key_range *min_key,
|
|||||||
DBUG_ENTER("ha_connect::records_in_range");
|
DBUG_ENTER("ha_connect::records_in_range");
|
||||||
|
|
||||||
if (indexing < 0 || inx != active_index)
|
if (indexing < 0 || inx != active_index)
|
||||||
index_init(inx, false);
|
if (index_init(inx, false))
|
||||||
|
DBUG_RETURN(HA_POS_ERROR);
|
||||||
|
|
||||||
if (xtrace)
|
if (xtrace)
|
||||||
htrc("records_in_range: inx=%d indexing=%d\n", inx, indexing);
|
htrc("records_in_range: inx=%d indexing=%d\n", inx, indexing);
|
||||||
|
@@ -80,7 +80,16 @@ HANDLE CreateFileMap(PGLOBAL g, LPCSTR filename,
|
|||||||
} // endif hFileMap
|
} // endif hFileMap
|
||||||
|
|
||||||
access = (mode == MODE_READ) ? FILE_MAP_READ : FILE_MAP_WRITE;
|
access = (mode == MODE_READ) ? FILE_MAP_READ : FILE_MAP_WRITE;
|
||||||
mm->memory = MapViewOfFile(hFileMap, access, 0, 0, 0);
|
|
||||||
|
if (!(mm->memory = MapViewOfFile(hFileMap, access, 0, 0, 0))) {
|
||||||
|
DWORD ler = GetLastError();
|
||||||
|
|
||||||
|
sprintf(g->Message, "Error %ld in MapViewOfFile %s",
|
||||||
|
ler, filename);
|
||||||
|
CloseHandle(hFile);
|
||||||
|
return INVALID_HANDLE_VALUE;
|
||||||
|
} // endif memory
|
||||||
|
|
||||||
// lenH is the high-order word of the file size
|
// lenH is the high-order word of the file size
|
||||||
mm->lenL = GetFileSize(hFile, &mm->lenH);
|
mm->lenL = GetFileSize(hFile, &mm->lenH);
|
||||||
CloseHandle(hFileMap); // Not used anymore
|
CloseHandle(hFileMap); // Not used anymore
|
||||||
|
@@ -35,7 +35,7 @@ Warning 1105 No table_type. Will be set to DOS
|
|||||||
SELECT * FROM t2;
|
SELECT * FROM t2;
|
||||||
line
|
line
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Created by CONNECT Version 1.02.0002 March 16, 2014 -->
|
<!-- Created by the MariaDB CONNECT Storage Engine-->
|
||||||
<t1>
|
<t1>
|
||||||
<row>
|
<row>
|
||||||
<TH>c</TH>
|
<TH>c</TH>
|
||||||
@@ -71,7 +71,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
SELECT * FROM t2;
|
SELECT * FROM t2;
|
||||||
line
|
line
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Created by CONNECT Version 1.02.0002 March 16, 2014 -->
|
<!-- Created by the MariaDB CONNECT Storage Engine-->
|
||||||
<t1>
|
<t1>
|
||||||
<row d="One">
|
<row d="One">
|
||||||
<c>1</c>
|
<c>1</c>
|
||||||
|
@@ -416,7 +416,7 @@ DROP TABLE t1;
|
|||||||
SET @a=LOAD_FILE('MYSQLD_DATADIR/test/t1.xml');
|
SET @a=LOAD_FILE('MYSQLD_DATADIR/test/t1.xml');
|
||||||
SELECT CAST(@a AS CHAR CHARACTER SET latin1);
|
SELECT CAST(@a AS CHAR CHARACTER SET latin1);
|
||||||
CAST(@a AS CHAR CHARACTER SET latin1) <?xml version="1.0" encoding="iso-8859-1"?>
|
CAST(@a AS CHAR CHARACTER SET latin1) <?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
<!-- Created by CONNECT Version 1.02.0002 March 16, 2014 -->
|
<!-- Created by the MariaDB CONNECT Storage Engine-->
|
||||||
<t1>
|
<t1>
|
||||||
<line>
|
<line>
|
||||||
<node>ÀÁÂÃ</node>
|
<node>ÀÁÂÃ</node>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -522,8 +522,8 @@ bool TDBXML::Initialize(PGLOBAL g)
|
|||||||
To_Xb = Docp->LinkXblock(g, Mode, rc, filename);
|
To_Xb = Docp->LinkXblock(g, Mode, rc, filename);
|
||||||
|
|
||||||
// Add a CONNECT comment node
|
// Add a CONNECT comment node
|
||||||
// sprintf(buf, MSG(CREATED_PLUGDB), version);
|
// sprintf(buf, " Created by CONNECT %s ", version);
|
||||||
sprintf(buf, " Created by CONNECT %s ", version);
|
strcpy(buf, " Created by the MariaDB CONNECT Storage Engine");
|
||||||
Docp->AddComment(g, buf);
|
Docp->AddComment(g, buf);
|
||||||
|
|
||||||
if (XmlDB) {
|
if (XmlDB) {
|
||||||
|
@@ -684,11 +684,14 @@ bool XINDEX::Make(PGLOBAL g, PIXDEF sxp)
|
|||||||
if (SaveIndex(g, sxp))
|
if (SaveIndex(g, sxp))
|
||||||
brc = true;
|
brc = true;
|
||||||
|
|
||||||
} else // Dynamic index
|
} else { // Dynamic index
|
||||||
// Indicate that key column values can be found from KEYCOL's
|
// Indicate that key column values can be found from KEYCOL's
|
||||||
for (kcp = To_KeyCol; kcp; kcp = kcp->Next)
|
for (kcp = To_KeyCol; kcp; kcp = kcp->Next)
|
||||||
kcp->Colp->SetKcol(kcp);
|
kcp->Colp->SetKcol(kcp);
|
||||||
|
|
||||||
|
Tdbp->SetFilter(NULL); // Not used anymore
|
||||||
|
} // endif X
|
||||||
|
|
||||||
err:
|
err:
|
||||||
// We don't need the index anymore
|
// We don't need the index anymore
|
||||||
if (X || brc)
|
if (X || brc)
|
||||||
@@ -2234,9 +2237,6 @@ int XINDXS::FastFind(int nk)
|
|||||||
XLOAD::XLOAD(void)
|
XLOAD::XLOAD(void)
|
||||||
{
|
{
|
||||||
Hfile = INVALID_HANDLE_VALUE;
|
Hfile = INVALID_HANDLE_VALUE;
|
||||||
#if defined(WIN32) && defined(XMAP)
|
|
||||||
ViewBase = NULL;
|
|
||||||
#endif // WIN32 && XMAP
|
|
||||||
NewOff.Val = 0LL;
|
NewOff.Val = 0LL;
|
||||||
} // end of XLOAD constructor
|
} // end of XLOAD constructor
|
||||||
|
|
||||||
@@ -2250,15 +2250,6 @@ void XLOAD::Close(void)
|
|||||||
Hfile = INVALID_HANDLE_VALUE;
|
Hfile = INVALID_HANDLE_VALUE;
|
||||||
} // endif Hfile
|
} // endif Hfile
|
||||||
|
|
||||||
#if defined(WIN32) && defined(XMAP)
|
|
||||||
if (ViewBase) {
|
|
||||||
if (!UnmapViewOfFile(ViewBase))
|
|
||||||
printf("Error %d closing Viewmap\n", GetLastError());
|
|
||||||
|
|
||||||
ViewBase = NULL;
|
|
||||||
} // endif ViewBase
|
|
||||||
#endif // WIN32 && XMAP
|
|
||||||
|
|
||||||
} // end of Close
|
} // end of Close
|
||||||
|
|
||||||
/* --------------------------- XFILE Class --------------------------- */
|
/* --------------------------- XFILE Class --------------------------- */
|
||||||
@@ -2269,9 +2260,9 @@ void XLOAD::Close(void)
|
|||||||
XFILE::XFILE(void) : XLOAD()
|
XFILE::XFILE(void) : XLOAD()
|
||||||
{
|
{
|
||||||
Xfile = NULL;
|
Xfile = NULL;
|
||||||
#if defined(XMAP) && !defined(WIN32)
|
#if defined(XMAP)
|
||||||
Mmp = NULL;
|
Mmp = NULL;
|
||||||
#endif // XMAP && !WIN32
|
#endif // XMAP
|
||||||
} // end of XFILE constructor
|
} // end of XFILE constructor
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
@@ -2414,11 +2405,9 @@ void XFILE::Close(void)
|
|||||||
Xfile = NULL;
|
Xfile = NULL;
|
||||||
} // endif Xfile
|
} // endif Xfile
|
||||||
|
|
||||||
#if defined(XMAP) && !defined(WIN32)
|
#if defined(XMAP)
|
||||||
if (Mmp) {
|
if (Mmp && CloseMemMap(Mmp->memory, Mmp->lenL))
|
||||||
CloseMemMap(Mmp->memory, Mmp->lenL);
|
printf("Error %d closing mapped index\n");
|
||||||
Mmp = NULL;
|
|
||||||
} // endif Mmp
|
|
||||||
#endif // XMAP
|
#endif // XMAP
|
||||||
} // end of Close
|
} // end of Close
|
||||||
|
|
||||||
@@ -2955,8 +2944,7 @@ bool KXYCOL::Init(PGLOBAL g, PCOL colp, int n, bool sm, int kln)
|
|||||||
// Allocate the Value object used when moving items
|
// Allocate the Value object used when moving items
|
||||||
Type = colp->GetResultType();
|
Type = colp->GetResultType();
|
||||||
|
|
||||||
if (!(Valp = AllocateValue(g, Type, len, colp->GetScale(),
|
if (!(Valp = AllocateValue(g, Type, len, prec, colp->IsUnsigned())))
|
||||||
colp->IsUnsigned())))
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
Klen = Valp->GetClen();
|
Klen = Valp->GetClen();
|
||||||
@@ -2992,7 +2980,7 @@ bool KXYCOL::Init(PGLOBAL g, PCOL colp, int n, bool sm, int kln)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
BYTE* KXYCOL::MapInit(PGLOBAL g, PCOL colp, int *n, BYTE *m)
|
BYTE* KXYCOL::MapInit(PGLOBAL g, PCOL colp, int *n, BYTE *m)
|
||||||
{
|
{
|
||||||
int len = colp->GetLength(), prec = colp->GetPrecision();
|
int len = colp->GetLength(), prec = colp->GetScale();
|
||||||
|
|
||||||
if (n[3] && colp->GetLength() > n[3]
|
if (n[3] && colp->GetLength() > n[3]
|
||||||
&& colp->GetResultType() == TYPE_STRING) {
|
&& colp->GetResultType() == TYPE_STRING) {
|
||||||
@@ -3002,12 +2990,12 @@ BYTE* KXYCOL::MapInit(PGLOBAL g, PCOL colp, int *n, BYTE *m)
|
|||||||
|
|
||||||
Type = colp->GetResultType();
|
Type = colp->GetResultType();
|
||||||
|
|
||||||
if (trace)
|
if (trace)
|
||||||
htrc("MapInit(%p): colp=%p type=%d n=%d len=%d m=%p\n",
|
htrc("MapInit(%p): colp=%p type=%d n=%d len=%d m=%p\n",
|
||||||
this, colp, Type, n[0], len, m);
|
this, colp, Type, n[0], len, m);
|
||||||
|
|
||||||
// Allocate the Value object used when moving items
|
// Allocate the Value object used when moving items
|
||||||
Valp = AllocateValue(g, Type, len, prec, false, NULL);
|
Valp = AllocateValue(g, Type, len, prec, colp->IsUnsigned());
|
||||||
Klen = Valp->GetClen();
|
Klen = Valp->GetClen();
|
||||||
|
|
||||||
if (n[2]) {
|
if (n[2]) {
|
||||||
@@ -3027,7 +3015,7 @@ BYTE* KXYCOL::MapInit(PGLOBAL g, PCOL colp, int *n, BYTE *m)
|
|||||||
// by blanks (if true) or keep the zero ending char (if false).
|
// by blanks (if true) or keep the zero ending char (if false).
|
||||||
// Currently we set it to true to be compatible with QRY blocks,
|
// Currently we set it to true to be compatible with QRY blocks,
|
||||||
// and last one to enable type checking (no conversion).
|
// and last one to enable type checking (no conversion).
|
||||||
Kblp = AllocValBlock(g, To_Keys, Type, n[0], len, prec, true, true);
|
Kblp = AllocValBlock(g, To_Keys, Type, n[0], len, prec, !Prefix, true);
|
||||||
|
|
||||||
if (n[1]) {
|
if (n[1]) {
|
||||||
Koff.Size = n[1] * sizeof(int);
|
Koff.Size = n[1] * sizeof(int);
|
||||||
@@ -3038,6 +3026,7 @@ BYTE* KXYCOL::MapInit(PGLOBAL g, PCOL colp, int *n, BYTE *m)
|
|||||||
Ndf = n[0];
|
Ndf = n[0];
|
||||||
//IsSorted = colp->GetOpt() < 0;
|
//IsSorted = colp->GetOpt() < 0;
|
||||||
IsSorted = false;
|
IsSorted = false;
|
||||||
|
Colp = colp;
|
||||||
return m + Bkeys.Size + Keys.Size + Koff.Size;
|
return m + Bkeys.Size + Keys.Size + Koff.Size;
|
||||||
} // end of MapInit
|
} // end of MapInit
|
||||||
#endif // XMAP
|
#endif // XMAP
|
||||||
|
@@ -347,9 +347,6 @@ class DllExport XLOAD : public BLOCK {
|
|||||||
// Members
|
// Members
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
HANDLE Hfile; // Handle to file or map
|
HANDLE Hfile; // Handle to file or map
|
||||||
#if defined(XMAP)
|
|
||||||
void *ViewBase; // Mapped view base address
|
|
||||||
#endif // XMAP
|
|
||||||
#else // UNIX
|
#else // UNIX
|
||||||
int Hfile; // Descriptor to file or map
|
int Hfile; // Descriptor to file or map
|
||||||
#endif // UNIX
|
#endif // UNIX
|
||||||
@@ -377,9 +374,9 @@ class DllExport XFILE : public XLOAD {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Members
|
// Members
|
||||||
FILE *Xfile; // Index stream file
|
FILE *Xfile; // Index stream file
|
||||||
#if defined(XMAP)
|
#if defined(XMAP)
|
||||||
MMP Mmp; // To mapped index file
|
MMP Mmp; // Mapped view base address and length
|
||||||
#endif // XMAP
|
#endif // XMAP
|
||||||
}; // end of class XFILE
|
}; // end of class XFILE
|
||||||
|
|
||||||
|
@@ -146,9 +146,10 @@ class DllExport TDBASE : public TDB {
|
|||||||
inline PCOL GetSetCols(void) {return To_SetCols;}
|
inline PCOL GetSetCols(void) {return To_SetCols;}
|
||||||
inline void SetSetCols(PCOL colp) {To_SetCols = colp;}
|
inline void SetSetCols(PCOL colp) {To_SetCols = colp;}
|
||||||
inline void SetXdp(PIXDEF xdp) {To_Xdp = xdp;}
|
inline void SetXdp(PIXDEF xdp) {To_Xdp = xdp;}
|
||||||
|
inline void SetKindex(PKXBASE kxp) {To_Kindex = kxp;}
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
void SetKindex(PGLOBAL g, PKXBASE kxp);
|
void ResetKindex(PGLOBAL g, PKXBASE kxp);
|
||||||
PCOL Key(int i) {return (To_Key_Col) ? To_Key_Col[i] : NULL;}
|
PCOL Key(int i) {return (To_Key_Col) ? To_Key_Col[i] : NULL;}
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
|
Reference in New Issue
Block a user