From 5813d639dea1ab7d4d8c338682bd7b4bf4f409d3 Mon Sep 17 00:00:00 2001 From: Ilya Kuznetsov Date: Wed, 27 May 2020 17:53:48 +0300 Subject: [PATCH] rt_mem_limit is now saved in the index header; rt_mem_limit is now reconfigurable in rt mode --- src/searchd.cpp | 32 ++++++++++- src/sphinxint.h | 4 +- src/sphinxpq.cpp | 4 +- src/sphinxrt.cpp | 123 ++++++++++++++++++++++++---------------- src/sphinxrt.h | 7 ++- test/test_405/model.bin | 10 +++- test/test_405/test.xml | 12 ++++ 7 files changed, 134 insertions(+), 58 deletions(-) diff --git a/src/searchd.cpp b/src/searchd.cpp index af2d65754c..b050df6c96 100644 --- a/src/searchd.cpp +++ b/src/searchd.cpp @@ -11819,6 +11819,25 @@ static const CSphSchema & GetSchemaForCreateTable ( CSphIndex * pIndex ) } +static CSphString BuildCreateTableRt ( const CSphString & sName, const CSphIndex * pIndex, const CSphSchema & tSchema ) +{ + assert(pIndex); + + CSphString sCreateTable = BuildCreateTable ( sName, pIndex, tSchema ); + + // FIXME: create a separate struct (and move it to indexsettings.cpp) when there are more RT-specific settings + if ( pIndex->IsRT() ) + { + auto * pRt = (RtIndex_i*)pIndex; + int64_t iMemLimit = pRt->GetMemLimit(); + if ( iMemLimit!=DEFAULT_RT_MEM_LIMIT ) + sCreateTable.SetSprintf ( "%s rt_mem_limit='" INT64_FMT "'", sCreateTable.cstr(), iMemLimit ); + } + + return sCreateTable; +} + + static void HandleMysqlCreateTableLike ( RowBuffer_i & tOut, const SqlStmt_t & tStmt, CSphString & sWarning ) { SearchFailuresLog_c dErrors; @@ -11858,7 +11877,7 @@ static void HandleMysqlCreateTableLike ( RowBuffer_i & tOut, const SqlStmt_t & t CSphString sCreateTable; if ( pServed ) - sCreateTable = BuildCreateTable ( tStmt.m_sIndex, pServed->m_pIndex, GetSchemaForCreateTable ( pServed->m_pIndex ) ); + sCreateTable = BuildCreateTableRt ( tStmt.m_sIndex, pServed->m_pIndex, GetSchemaForCreateTable ( pServed->m_pIndex ) ); else sCreateTable = BuildCreateTableDistr ( tStmt.m_sIndex, *pDist ); @@ -11924,7 +11943,7 @@ void HandleMysqlShowCreateTable ( RowBuffer_i & tOut, const SqlStmt_t & tStmt ) tOut.HeadTuplet ( "Table", "Create Table" ); CSphString sCreateTable; if ( pServed ) - sCreateTable = BuildCreateTable ( pServed->m_pIndex->GetName(), pServed->m_pIndex, GetSchemaForCreateTable ( pServed->m_pIndex ) ); + sCreateTable = BuildCreateTableRt ( pServed->m_pIndex->GetName(), pServed->m_pIndex, GetSchemaForCreateTable ( pServed->m_pIndex ) ); else sCreateTable = BuildCreateTableDistr ( tStmt.m_sIndex, *pDist ); @@ -14594,6 +14613,7 @@ static bool PrepareReconfigure ( const CSphString & sIndex, const CSphConfigSect tSettings.m_tTokenizer.Setup ( hIndex, sWarning ); tSettings.m_tDict.Setup ( hIndex, pFilenameBuilder.Ptr(), sWarning ); tSettings.m_tFieldFilter.Setup ( hIndex, sWarning ); + tSettings.m_iMemLimit = hIndex.GetSize64 ( "rt_mem_limit", DEFAULT_RT_MEM_LIMIT ); sphRTSchemaConfigure ( hIndex, tSettings.m_tSchema, sError, true ); @@ -14644,6 +14664,12 @@ static void HandleMysqlReconfigure ( RowBuffer_i & tOut, const SqlStmt_t & tStmt { MEMORY ( MEM_SQL_ALTER ); + if ( IsConfigless() ) + { + tOut.Error ( tStmt.m_sStmt, "ALTER RECONFIGURE is not supported in RT mode" ); + return; + } + const CSphString & sIndex = tStmt.m_sIndex.cstr(); CSphString sError; CSphReconfigureSettings tSettings; @@ -17066,7 +17092,7 @@ ESphAddIndex AddRTIndex ( GuardedHash_c & dPost, const char * szIndexName, const } // RAM chunk size - int64_t iRamSize = hIndex.GetSize64 ( "rt_mem_limit", 128 * 1024 * 1024 ); + int64_t iRamSize = hIndex.GetSize64 ( "rt_mem_limit", DEFAULT_RT_MEM_LIMIT ); if ( iRamSize<128 * 1024 ) { sphWarning ( "index '%s': rt_mem_limit extremely low, using 128K instead", szIndexName ); diff --git a/src/sphinxint.h b/src/sphinxint.h index 4a02bb4b24..677ecebe80 100644 --- a/src/sphinxint.h +++ b/src/sphinxint.h @@ -1595,15 +1595,17 @@ struct CSphReconfigureSettings CSphIndexSettings m_tIndex; CSphFieldFilterSettings m_tFieldFilter; CSphSchema m_tSchema; + int64_t m_iMemLimit = 0; }; struct CSphReconfigureSetup { TokenizerRefPtr_c m_pTokenizer; DictRefPtr_c m_pDict; - CSphIndexSettings m_tIndex; + CSphIndexSettings m_tIndex; FieldFilterRefPtr_c m_pFieldFilter; CSphSchema m_tSchema; + int64_t m_iMemLimit = 0; }; uint64_t sphGetSettingsFNV ( const CSphIndexSettings & tSettings ); diff --git a/src/sphinxpq.cpp b/src/sphinxpq.cpp index 42c31bdf89..fed1b1cbe6 100644 --- a/src/sphinxpq.cpp +++ b/src/sphinxpq.cpp @@ -144,6 +144,8 @@ class PercolateIndex_c : public PercolateIndex_i const CSphSchema &GetMatchSchema () const override { return m_tMatchSchema; } + int64_t GetMemLimit() const final { return 0; } + private: static const DWORD META_HEADER_MAGIC = 0x50535451; ///< magic 'PSTQ' header static const DWORD META_VERSION = 8; ///< current version, new index format @@ -2394,7 +2396,7 @@ bool PercolateIndex_c::IsSameSettings ( CSphReconfigureSettings & tSettings, CSp bool bSameSchema = m_tSchema.CompareTo ( tSettings.m_tSchema, sTmp, false ); return CreateReconfigure ( m_sIndexName, IsStarDict ( m_pDict->GetSettings().m_bWordDict ), m_pFieldFilter, m_tSettings, m_pTokenizer->GetSettingsFNV(), - m_pDict->GetSettingsFNV(), m_pTokenizer->GetMaxCodepointLength(), + m_pDict->GetSettingsFNV(), m_pTokenizer->GetMaxCodepointLength(), GetMemLimit(), bSameSchema, tSettings, tSetup, dWarnings, sError ); } diff --git a/src/sphinxrt.cpp b/src/sphinxrt.cpp index ee485ad733..7605b9cb6f 100644 --- a/src/sphinxrt.cpp +++ b/src/sphinxrt.cpp @@ -1174,7 +1174,7 @@ class RtIndex_c final : public RtIndex_i, public ISphNoncopyable, public ISphWor private: static const DWORD META_HEADER_MAGIC = 0x54525053; ///< my magic 'SPRT' header - static const DWORD META_VERSION = 16; ///< current version + static const DWORD META_VERSION = 17; ///< current version int m_iStride; LazyVector_T m_dRamChunks GUARDED_BY ( m_tChunkLock ); @@ -1237,6 +1237,8 @@ class RtIndex_c final : public RtIndex_i, public ISphNoncopyable, public ISphWor RtSegment_t * MergeSegments ( const RtSegment_t * pSeg1, const RtSegment_t * pSeg2, bool bHasMorphology ) const; void CopyWord ( RtSegment_t & tDst, const RtSegment_t & tSrc, RtDocWriter_t & tOutDoc, RtDocReader_t & tInDoc, RtWord_t & tWord, const CSphVector & tRowMap ) const; + bool LoadMeta ( FilenameBuilder_i * pFilenameBuilder, bool bStripPath, DWORD & uVersion, bool & bRebuildInfixes ); + bool LoadDiskChunks ( FilenameBuilder_i * pFilenameBuilder ); void SaveMeta ( int64_t iTID, const VecTraits_T & dChunkNames ); void SaveDiskHeader ( SaveDiskDataContext_t & tCtx, const ChunkStats_t & tStats ) const; void SaveDiskData ( const char * sFilename, const SphChunkGuard_t & tGuard, const ChunkStats_t & tStats ) const; @@ -1276,6 +1278,7 @@ class RtIndex_c final : public RtIndex_i, public ISphNoncopyable, public ISphWor bool MergeSegments ( CSphVector & dSegments, bool bForceDump, int64_t iMemLimit, bool bHasNewSegment ); RtSegmentRefPtf_t MergeDoubleBufSegments ( CSphVector & dSegments ) const; bool NeedStoreWordID () const override; + int64_t GetMemLimit() const final { return m_iSoftRamLimit; } }; @@ -3654,6 +3657,9 @@ void RtIndex_c::SaveMeta ( int64_t iTID, const VecTraits_T & dChunkNames ) wrMeta.PutDword ( dChunkNames.GetLength () ); wrMeta.PutBytes ( dChunkNames.Begin(), dChunkNames.GetLengthBytes() ); + // meta v.17+ + wrMeta.PutOffset(m_iSoftRamLimit); + wrMeta.CloseFile(); // no need to remove old but good meta in case new meta failed to save @@ -3822,41 +3828,8 @@ CSphIndex * RtIndex_c::LoadDiskChunk ( const char * sChunk, int iChunk, Filename } -bool RtIndex_c::Prealloc ( bool bStripPath, FilenameBuilder_i * pFilenameBuilder ) +bool RtIndex_c::LoadMeta ( FilenameBuilder_i * pFilenameBuilder, bool bStripPath, DWORD & uVersion, bool & bRebuildInfixes ) { - MEMORY ( MEM_INDEX_RT ); - - // locking uber alles - // in RT backend case, we just must be multi-threaded - // so we simply lock here, and ignore Lock/Unlock hassle caused by forks - assert ( m_iLockFD<0 ); - - CSphString sLock; - sLock.SetSprintf ( "%s.lock", m_sPath.cstr() ); - m_iLockFD = ::open ( sLock.cstr(), SPH_O_NEW, 0644 ); - if ( m_iLockFD<0 ) - { - m_sLastError.SetSprintf ( "failed to open %s: %s", sLock.cstr(), strerrorm(errno) ); - return false; - } - - if ( !sphLockEx ( m_iLockFD, false ) ) - { - if ( !m_bDebugCheck ) - { - m_sLastError.SetSprintf ( "failed to lock %s: %s", sLock.cstr(), strerrorm(errno) ); - SafeClose ( m_iLockFD ); - return false; - } else - { - SafeClose ( m_iLockFD ); - } - } - - ///////////// - // load meta - ///////////// - // check if we have a meta file (kinda-header) CSphString sMeta; sMeta.SetSprintf ( "%s.meta", m_sPath.cstr() ); @@ -3875,7 +3848,8 @@ bool RtIndex_c::Prealloc ( bool bStripPath, FilenameBuilder_i * pFilenameBuilder m_sLastError.SetSprintf ( "invalid meta file %s", sMeta.cstr() ); return false; } - DWORD uVersion = rdMeta.GetDword(); + + uVersion = rdMeta.GetDword(); if ( uVersion==0 || uVersion>META_VERSION ) { m_sLastError.SetSprintf ( "%s is v.%d, binary is v.%d", sMeta.cstr(), uVersion, META_VERSION ); @@ -3952,7 +3926,6 @@ bool RtIndex_c::Prealloc ( bool bStripPath, FilenameBuilder_i * pFilenameBuilder m_iWordsCheckpoint = rdMeta.GetDword(); // check that infixes definition changed - going to rebuild infixes - bool bRebuildInfixes = false; m_iMaxCodepointLength = rdMeta.GetDword(); int iBloomKeyLen = rdMeta.GetByte(); int iBloomHashesCount = rdMeta.GetByte(); @@ -3960,7 +3933,7 @@ bool RtIndex_c::Prealloc ( bool bStripPath, FilenameBuilder_i * pFilenameBuilder if ( bRebuildInfixes ) sphWarning ( "infix definition changed (from len=%d, hashes=%d to len=%d, hashes=%d) - rebuilding...", - (int)BLOOM_PER_ENTRY_VALS_COUNT, (int)BLOOM_HASHES_COUNT, iBloomKeyLen, iBloomHashesCount ); + (int)BLOOM_PER_ENTRY_VALS_COUNT, (int)BLOOM_HASHES_COUNT, iBloomKeyLen, iBloomHashesCount ); FieldFilterRefPtr_c pFieldFilter; CSphFieldFilterSettings tFieldFilterSettings; @@ -3976,15 +3949,16 @@ bool RtIndex_c::Prealloc ( bool bStripPath, FilenameBuilder_i * pFilenameBuilder int iLen = (int)rdMeta.GetDword(); m_dChunkNames.Reset ( iLen ); rdMeta.GetBytes ( m_dChunkNames.Begin(), iLen*sizeof(int) ); - if ( m_bDebugCheck ) - return true; - /////////////// - // load chunks - /////////////// + if ( uVersion>=17 ) + m_iSoftRamLimit = rdMeta.GetOffset(); + + return true; +} - m_bPathStripped = bStripPath; +bool RtIndex_c::LoadDiskChunks ( FilenameBuilder_i * pFilenameBuilder ) +{ // load disk chunks, if any ARRAY_FOREACH ( iName, m_dChunkNames ) { @@ -4012,7 +3986,55 @@ bool RtIndex_c::Prealloc ( bool bStripPath, FilenameBuilder_i * pFilenameBuilder } } - m_dChunkNames.Reset ( 0 ); + m_dChunkNames.Reset(0); + + return true; +} + + +bool RtIndex_c::Prealloc ( bool bStripPath, FilenameBuilder_i * pFilenameBuilder ) +{ + MEMORY ( MEM_INDEX_RT ); + + // locking uber alles + // in RT backend case, we just must be multi-threaded + // so we simply lock here, and ignore Lock/Unlock hassle caused by forks + assert ( m_iLockFD<0 ); + + CSphString sLock; + sLock.SetSprintf ( "%s.lock", m_sPath.cstr() ); + m_iLockFD = ::open ( sLock.cstr(), SPH_O_NEW, 0644 ); + if ( m_iLockFD<0 ) + { + m_sLastError.SetSprintf ( "failed to open %s: %s", sLock.cstr(), strerrorm(errno) ); + return false; + } + + if ( !sphLockEx ( m_iLockFD, false ) ) + { + if ( !m_bDebugCheck ) + { + m_sLastError.SetSprintf ( "failed to lock %s: %s", sLock.cstr(), strerrorm(errno) ); + SafeClose ( m_iLockFD ); + return false; + } else + { + SafeClose ( m_iLockFD ); + } + } + + DWORD uVersion = 0; + bool bRebuildInfixes = false; + if ( !LoadMeta ( pFilenameBuilder, bStripPath, uVersion, bRebuildInfixes ) ) + return false; + + if ( m_bDebugCheck ) + return true; + + m_bPathStripped = bStripPath; + + if ( !LoadDiskChunks ( pFilenameBuilder ) ) + return false; // load ram chunk bool bRamLoaded = LoadRamChunk ( uVersion, bRebuildInfixes ); @@ -7830,7 +7852,7 @@ void RtIndex_c::GetStatus ( CSphIndexStatus * pRes ) const ////////////////////////////////////////////////////////////////////////// bool CreateReconfigure ( const CSphString & sIndexName, bool bIsStarDict, const ISphFieldFilter * pFieldFilter, - const CSphIndexSettings & tIndexSettings, uint64_t uTokHash, uint64_t uDictHash, int iMaxCodepointLength, + const CSphIndexSettings & tIndexSettings, uint64_t uTokHash, uint64_t uDictHash, int iMaxCodepointLength, int64_t iMemLimit, bool bSame, CSphReconfigureSettings & tSettings, CSphReconfigureSetup & tSetup, StrVec_t & dWarnings, CSphString & sError ) { CreateFilenameBuilder_fn fnCreateFilenameBuilder = GetIndexFilenameBuilder(); @@ -7926,12 +7948,13 @@ bool CreateReconfigure ( const CSphString & sIndexName, bool bIsStarDict, const // compare options if ( !bSame || uTokHash!=pTokenizer->GetSettingsFNV() || uDictHash!=tDict->GetSettingsFNV() || iMaxCodepointLength!=pTokenizer->GetMaxCodepointLength() || sphGetSettingsFNV ( tIndexSettings )!=sphGetSettingsFNV ( tSettings.m_tIndex ) || - !bReFilterSame || !bIcuSame ) + !bReFilterSame || !bIcuSame || iMemLimit!=tSettings.m_iMemLimit ) { tSetup.m_pTokenizer = pTokenizer.Leak(); tSetup.m_pDict = tDict.Leak(); tSetup.m_tIndex = tSettings.m_tIndex; tSetup.m_pFieldFilter = tFieldFilter.Leak(); + tSetup.m_iMemLimit = tSettings.m_iMemLimit; return false; } @@ -7941,8 +7964,8 @@ bool CreateReconfigure ( const CSphString & sIndexName, bool bIsStarDict, const bool RtIndex_c::IsSameSettings ( CSphReconfigureSettings & tSettings, CSphReconfigureSetup & tSetup, StrVec_t & dWarnings, CSphString & sError ) const { - return CreateReconfigure ( m_sIndexName, IsStarDict ( m_bKeywordDict ), m_pFieldFilter, m_tSettings, - m_pTokenizer->GetSettingsFNV(), m_pDict->GetSettingsFNV(), m_pTokenizer->GetMaxCodepointLength(), true, tSettings, tSetup, dWarnings, sError ); + return CreateReconfigure ( m_sIndexName, IsStarDict ( m_bKeywordDict ), m_pFieldFilter, m_tSettings, m_pTokenizer->GetSettingsFNV(), m_pDict->GetSettingsFNV(), m_pTokenizer->GetMaxCodepointLength(), + GetMemLimit(), true, tSettings, tSetup, dWarnings, sError ); } bool RtIndex_c::Reconfigure ( CSphReconfigureSetup & tSetup ) @@ -7950,6 +7973,8 @@ bool RtIndex_c::Reconfigure ( CSphReconfigureSetup & tSetup ) if ( !ForceDiskChunk() ) return false; + m_iSoftRamLimit = tSetup.m_iMemLimit; + Setup ( tSetup.m_tIndex ); SetTokenizer ( tSetup.m_pTokenizer ); SetDictionary ( tSetup.m_pDict ); diff --git a/src/sphinxrt.h b/src/sphinxrt.h index 568b585d25..cee0c6566d 100644 --- a/src/sphinxrt.h +++ b/src/sphinxrt.h @@ -25,6 +25,8 @@ struct CSphReconfigureSettings; struct CSphReconfigureSetup; class RtAccum_t; +const int64_t DEFAULT_RT_MEM_LIMIT = 128 * 1024 * 1024; + /// RAM based updateable backend interface class RtIndex_i : public CSphIndex @@ -96,7 +98,8 @@ class RtIndex_i : public CSphIndex /// returns NULL if another index already uses it in an open txn RtAccum_t * AcquireAccum ( CSphDict * pDict, RtAccum_t * pAccExt=nullptr, bool bWordDict=true, bool bSetTLS = true, CSphString * sError=nullptr ); - virtual bool NeedStoreWordID () const = 0; + virtual bool NeedStoreWordID () const = 0; + virtual int64_t GetMemLimit() const = 0; }; /// initialize subsystem @@ -359,7 +362,7 @@ void SetupExactDict ( DictRefPtr_c &pDict, ISphTokenizer * pTokenizer, bool bAdd void SetupStarDict ( DictRefPtr_c &pDict, ISphTokenizer * pTokenizer ); bool CreateReconfigure ( const CSphString & sIndexName, bool bIsStarDict, const ISphFieldFilter * pFieldFilter, - const CSphIndexSettings & tIndexSettings, uint64_t uTokHash, uint64_t uDictHash, int iMaxCodepointLength, + const CSphIndexSettings & tIndexSettings, uint64_t uTokHash, uint64_t uDictHash, int iMaxCodepointLength, int64_t iMemLimit, bool bSame, CSphReconfigureSettings & tSettings, CSphReconfigureSetup & tSetup, StrVec_t & dWarnings, CSphString & sError ); // Get global flag of w-available RT diff --git a/test/test_405/model.bin b/test/test_405/model.bin index c16c54267d..5e1fd54b76 100644 --- a/test/test_405/model.bin +++ b/test/test_405/model.bin @@ -1,2 +1,8 @@ -a:1:{i:0;a:14:{i:0;a:2:{s:8:"sphinxql";s:46:"create table test1 ( title text, tag integer )";s:14:"total_affected";i:0;}i:1;a:2:{s:8:"sphinxql";s:45:"insert into test1 values (1, 'word form', 11)";s:14:"total_affected";i:1;}i:2;a:2:{s:8:"sphinxql";s:46:"select * from test1 where match ( 'wordform' )";s:10:"total_rows";i:0;}i:3;a:2:{s:8:"sphinxql";s:45:"alter table test1 wordforms = 'wordforms.txt'";s:14:"total_affected";i:0;}i:4;a:2:{s:8:"sphinxql";s:45:"insert into test1 values (2, 'word form', 11)";s:14:"total_affected";i:1;}i:5;a:3:{s:8:"sphinxql";s:46:"select * from test1 where match ( 'wordform' )";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:3:{s:2:"id";s:1:"2";s:3:"tag";s:2:"11";s:5:"title";s:9:"word form";}}}i:6;a:2:{s:8:"sphinxql";s:64:"CREATE TABLE test11 (title TEXT, category INT) min_infix_len='4'";s:14:"total_affected";i:0;}i:7;a:2:{s:8:"sphinxql";s:31:"CREATE TABLE test12 LIKE test11";s:14:"total_affected";i:0;}i:8;a:2:{s:8:"sphinxql";s:35:"ALTER TABLE test11 ignore_chars='.'";s:14:"total_affected";i:0;}i:9;a:3:{s:8:"sphinxql";s:26:"SHOW INDEX test11 SETTINGS";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:2:{s:13:"Variable_name";s:8:"settings";s:5:"Value";s:34:"min_infix_len = 4 -ignore_chars = .";}}}i:10;a:3:{s:8:"sphinxql";s:26:"SHOW INDEX test12 SETTINGS";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:2:{s:13:"Variable_name";s:8:"settings";s:5:"Value";s:17:"min_infix_len = 4";}}}i:11;a:2:{s:8:"sphinxql";s:16:"drop table test1";s:14:"total_affected";i:0;}i:12;a:2:{s:8:"sphinxql";s:17:"drop table test11";s:14:"total_affected";i:0;}i:13;a:2:{s:8:"sphinxql";s:17:"drop table test12";s:14:"total_affected";i:0;}}} \ No newline at end of file +a:1:{i:0;a:23:{i:0;a:2:{s:8:"sphinxql";s:46:"create table test1 ( title text, tag integer )";s:14:"total_affected";i:0;}i:1;a:2:{s:8:"sphinxql";s:45:"insert into test1 values (1, 'word form', 11)";s:14:"total_affected";i:1;}i:2;a:2:{s:8:"sphinxql";s:46:"select * from test1 where match ( 'wordform' )";s:10:"total_rows";i:0;}i:3;a:2:{s:8:"sphinxql";s:45:"alter table test1 wordforms = 'wordforms.txt'";s:14:"total_affected";i:0;}i:4;a:2:{s:8:"sphinxql";s:45:"insert into test1 values (2, 'word form', 11)";s:14:"total_affected";i:1;}i:5;a:3:{s:8:"sphinxql";s:46:"select * from test1 where match ( 'wordform' )";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:3:{s:2:"id";s:1:"2";s:3:"tag";s:2:"11";s:5:"title";s:9:"word form";}}}i:6;a:2:{s:8:"sphinxql";s:64:"CREATE TABLE test11 (title TEXT, category INT) min_infix_len='4'";s:14:"total_affected";i:0;}i:7;a:2:{s:8:"sphinxql";s:31:"CREATE TABLE test12 LIKE test11";s:14:"total_affected";i:0;}i:8;a:2:{s:8:"sphinxql";s:35:"ALTER TABLE test11 ignore_chars='.'";s:14:"total_affected";i:0;}i:9;a:3:{s:8:"sphinxql";s:26:"SHOW INDEX test11 SETTINGS";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:2:{s:13:"Variable_name";s:8:"settings";s:5:"Value";s:34:"min_infix_len = 4 +ignore_chars = .";}}}i:10;a:3:{s:8:"sphinxql";s:26:"SHOW INDEX test12 SETTINGS";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:2:{s:13:"Variable_name";s:8:"settings";s:5:"Value";s:17:"min_infix_len = 4";}}}i:11;a:2:{s:8:"sphinxql";s:16:"drop table test1";s:14:"total_affected";i:0;}i:12;a:2:{s:8:"sphinxql";s:17:"drop table test11";s:14:"total_affected";i:0;}i:13;a:2:{s:8:"sphinxql";s:17:"drop table test12";s:14:"total_affected";i:0;}i:14;a:2:{s:8:"sphinxql";s:49:"CREATE TABLE test1 (title text) rt_mem_limit='2G'";s:14:"total_affected";i:0;}i:15;a:2:{s:8:"sphinxql";s:29:"CREATE TABLE test2 LIKE test1";s:14:"total_affected";i:0;}i:16;a:3:{s:8:"sphinxql";s:23:"SHOW CREATE TABLE test1";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:2:{s:5:"Table";s:5:"test1";s:12:"Create Table";s:59:"CREATE TABLE test1 ( +title text +) rt_mem_limit='2147483648'";}}}i:17;a:3:{s:8:"sphinxql";s:23:"SHOW CREATE TABLE test2";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:2:{s:5:"Table";s:5:"test2";s:12:"Create Table";s:59:"CREATE TABLE test2 ( +title text +) rt_mem_limit='2147483648'";}}}i:18;a:2:{s:8:"sphinxql";s:35:"ALTER TABLE test1 rt_mem_limit='1G'";s:14:"total_affected";i:0;}i:19;a:3:{s:8:"sphinxql";s:23:"SHOW CREATE TABLE test1";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:2:{s:5:"Table";s:5:"test1";s:12:"Create Table";s:59:"CREATE TABLE test1 ( +title text +) rt_mem_limit='1073741824'";}}}i:20;a:2:{s:8:"sphinxql";s:16:"drop table test1";s:14:"total_affected";i:0;}i:21;a:2:{s:8:"sphinxql";s:16:"drop table test2";s:14:"total_affected";i:0;}i:22;a:3:{s:8:"sphinxql";s:29:"ALTER TABLE test1 RECONFIGURE";s:5:"error";s:45:"ALTER RECONFIGURE is not supported in RT mode";s:5:"errno";i:1064;}}} \ No newline at end of file diff --git a/test/test_405/test.xml b/test/test_405/test.xml index 804bd48e66..59c1078fdc 100644 --- a/test/test_405/test.xml +++ b/test/test_405/test.xml @@ -39,6 +39,18 @@ searchd drop table test11 drop table test12 +CREATE TABLE test1 (title text) rt_mem_limit='2G' +CREATE TABLE test2 LIKE test1 +SHOW CREATE TABLE test1 +SHOW CREATE TABLE test2 + +ALTER TABLE test1 rt_mem_limit='1G' +SHOW CREATE TABLE test1 + +drop table test1 +drop table test2 + +ALTER TABLE test1 RECONFIGURE