Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/queuecreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1129,9 +1129,7 @@ bool QueueCreator_c::ParseQueryItem ( const CSphQueryItem & tItem )
if ( sExpr==sphGetDocidName() || sExpr=="@id" )
{
CSphQueryItem tUuidItem = tItem;
tUuidItem.m_sExpr = sphGetUuidDocidName();
if ( tUuidItem.m_sAlias.IsEmpty() || tUuidItem.m_sAlias==sphGetDocidName() )
tUuidItem.m_sAlias = sphGetDocidName();
tUuidItem.m_sExpr = tUuidItem.m_sAlias = sphGetUuidDocidName();
return ParseResolvedQueryItem ( tUuidItem );
}

Expand Down
1 change: 1 addition & 0 deletions test/test_506/model.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a:1:{i:0;a:6:{i:0;a:2:{s:8:"sphinxql";s:73:"CREATE TABLE uuid_stored_text ( id uuid, merchant_id string, title text )";s:14:"total_affected";i:0;}i:1;a:2:{s:8:"sphinxql";s:77:"CREATE TABLE bigint_stored_text ( id bigint, merchant_id string, title text )";s:14:"total_affected";i:0;}i:2;a:2:{s:8:"sphinxql";s:136:"REPLACE INTO uuid_stored_text ( id, merchant_id, title ) VALUES ( '550e8400-e29b-41d4-a716-846655440001', 'merchant-1', 'Widget Alpha' )";s:14:"total_affected";i:1;}i:3;a:2:{s:8:"sphinxql";s:101:"REPLACE INTO bigint_stored_text ( id, merchant_id, title ) VALUES ( 1, 'merchant-1', 'Widget Alpha' )";s:14:"total_affected";i:1;}i:4;a:3:{s:8:"sphinxql";s:73:"SELECT id, merchant_id, title FROM uuid_stored_text WHERE MATCH('Widget')";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:3:{s:2:"id";s:36:"550e8400-e29b-41d4-a716-846655440001";s:11:"merchant_id";s:10:"merchant-1";s:5:"title";s:12:"Widget Alpha";}}}i:5;a:3:{s:8:"sphinxql";s:75:"SELECT id, merchant_id, title FROM bigint_stored_text WHERE MATCH('Widget')";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:3:{s:2:"id";s:1:"1";s:11:"merchant_id";s:10:"merchant-1";s:5:"title";s:12:"Widget Alpha";}}}}}
30 changes: 30 additions & 0 deletions test/test_506/test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<test>
<name>UUID id SQL projection preserves stored text fields</name>

<requires>
<force-rt/>
</requires>
<skip_indexer/>
<skip_db/>

<config>
searchd
{
<searchd_settings/>
data_dir = <data_path/>
binlog_path =
}
</config>

<queries>
<sphinxql>
CREATE TABLE uuid_stored_text ( id uuid, merchant_id string, title text );
CREATE TABLE bigint_stored_text ( id bigint, merchant_id string, title text );
REPLACE INTO uuid_stored_text ( id, merchant_id, title ) VALUES ( '550e8400-e29b-41d4-a716-846655440001', 'merchant-1', 'Widget Alpha' );
REPLACE INTO bigint_stored_text ( id, merchant_id, title ) VALUES ( 1, 'merchant-1', 'Widget Alpha' );
SELECT id, merchant_id, title FROM uuid_stored_text WHERE MATCH('Widget');
SELECT id, merchant_id, title FROM bigint_stored_text WHERE MATCH('Widget');
</sphinxql>
</queries>
</test>
Loading