• davi@mysql.com/endora.local's avatar
    Bug#35788 A few tests fail due to concurrent inserts · 2bf61233
    davi@mysql.com/endora.local authored
    The problem is that since MyISAM's concurrent_insert is on by
    default some concurrent SELECT statements might not see changes
    made by INSERT statements in other connections, even if the
    INSERT statement has returned.
    
    The solution is to disable concurrent_insert so that INSERT
    statements returns after the data is actually visible to other
    statements.
    2bf61233
client_xml.result 2.32 KB
set @old_concurrent_insert= @@global.concurrent_insert;
set @@global.concurrent_insert= 0;
create table t1 (
`a&b` int,
`a<b` int,
`a>b` text
);
insert into t1 values (1, 2, 'a&b a<b a>b');
<?xml version="1.0"?>

<resultset statement="select * from t1
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <row>
	<field name="a&amp;b">1</field>
	<field name="a&lt;b">2</field>
	<field name="a&gt;b">a&amp;b a&lt;b a&gt;b</field>
  </row>
</resultset>
<?xml version="1.0"?>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
	<table_structure name="t1">
		<field Field="a&amp;b" Type="int(11)" Null="YES" Key="" Extra="" />
		<field Field="a&lt;b" Type="int(11)" Null="YES" Key="" Extra="" />
		<field Field="a&gt;b" Type="text" Null="YES" Key="" Extra="" />
	</table_structure>
	<table_data name="t1">
	<row>
		<field name="a&amp;b">1</field>
		<field name="a&lt;b">2</field>
		<field name="a&gt;b">a&amp;b a&lt;b a&gt;b</field>
	</row>
	</table_data>
</database>
</mysqldump>
<?xml version="1.0"?>

<resultset statement="select count(*) from t1
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <row>
	<field name="count(*)">1</field>
  </row>
</resultset>
<?xml version="1.0"?>

<resultset statement="select 1 &lt; 2 from dual
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <row>
	<field name="1 &lt; 2">1</field>
  </row>
</resultset>
<?xml version="1.0"?>

<resultset statement="select 1 &gt; 2 from dual
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <row>
	<field name="1 &gt; 2">0</field>
  </row>
</resultset>
<?xml version="1.0"?>

<resultset statement="select 1 &amp; 3 from dual
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <row>
	<field name="1 &amp; 3">1</field>
  </row>
</resultset>
<?xml version="1.0"?>

<resultset statement="select null from dual
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <row>
	<field name="NULL" xsi:nil="true" />
  </row>
</resultset>
<?xml version="1.0"?>

<resultset statement="select 1 limit 0
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></resultset>
--------------
select 1 limit 0
--------------

<?xml version="1.0"?>

<resultset statement="select 1 limit 0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></resultset>
Empty set

Bye
drop table t1;
set @@global.concurrent_insert= @old_concurrent_insert;