Re: [Maria-developers] b1a1e5b: MDEV-6058 MySQL Bug #11766693: LOG-SLOW-ADMIN-STATEMENTS AND LOG-SLOW-SLAVE-STATEMENTS NOT DISPLAYED.

2016-03-18 Thread Sachin Setia
Dear Mr Sergei
Sorry for a careless mistake I thought prototype is working but it is
working only for InnoDB not for MyIsam because if we look at table creation
which I send you

MariaDB [sachin]> create table tbl(int_key int primary key , blob_key
blob unique);
Query OK, 0 rows affected (0.03 sec)

Here I forgot to add engine =myisam .
If we the same table creation for myisam table get created but at the time
of insert we get this message

ERROR 1030 (HY000): Got error 190 "Incompatible key or row definition
between the MariaDB .frm file and the information in the storage engine.
You have to dump an" from storage engine MyISAM

We are getting this becuase in mi_create for each unique_def it creates one
keydef and writes it.And this creates two  problem
1. frm keydef algorithm is different from saved kefdef algorithm(always
zero) for the time I have solved this problem .

2.Mismatch between keydef's keysegs the reason for this is when mi_create
creates keyseg for unique_def it did not keeps the orignal uniquedef's
keyseg parameters in mind like language start length which creates problem
in check_definition function in ha_myisam.cc.I am currently working on it
Once again sorry for this foolish mistake.
Regars
sachin

On Fri, Mar 18, 2016 at 3:16 PM, Sergei Golubchik  wrote:

> Hi, Alexey!
>
> On Mar 18, Alexey Botchkov wrote:
> > revision-id: b1a1e5b3d3d5ab95c596580de07daf38a3efa039
> (mariadb-10.1.12-19-gb1a1e5b)
> > parent(s): 4aac51db9a55a11574cbfa60484d4329d35b6f2c
> > committer: Alexey Botchkov
> > timestamp: 2016-03-18 11:47:05 +0400
> > message:
> >
> > MDEV-6058 MySQL Bug #11766693: LOG-SLOW-ADMIN-STATEMENTS AND
> LOG-SLOW-SLAVE-STATEMENTS NOT DISPLAYED.
> > These parameters were moved from the command line options to the
> > system variables section. Treatment of the
> > opt_log_slow_slave_statements changed to let the dynamic change
> > of the variable.
> >
> > ---
> >  mysql-test/r/variables.result  |  10 ++
> >  mysql-test/suite/rpl/r/rpl_slow_query_log.result   |  10 ++
> >  mysql-test/suite/rpl/t/rpl_slow_query_log.test |  43 
> >  .../r/log_slow_admin_statements_basic.result   |  76 ++
> >  .../r/log_slow_admin_statements_func.result|  46 +
> >  .../r/log_slow_slave_statements_basic.result   |  76 ++
> >  .../t/log_slow_admin_statements_basic.test | 110
> +
> >  .../sys_vars/t/log_slow_admin_statements_func.test |  61 
> >  .../t/log_slow_slave_statements_basic.test | 110
> +
> >  mysql-test/t/variables.test|  11 +++
>
> I suppose you didn't run the full test suite. Otherwise you would've
> noticed that sysvar_* results were changed.
>
> Also, because we have sysvar_* tests, we no longer create
> _basic tests for every new variable, they are no longer useful.
> Starting from 10.1 you only need to test the functionality of new
> variables, not their basic properties.
>
> >  sql/log_event.cc   |  10 ++
> >  sql/mysqld.cc  |   8 --
> >  sql/sys_vars.cc|  13 +++
> >  13 files changed, 576 insertions(+), 8 deletions(-)
> >
> > diff --git a/mysql-test/r/variables.result
> b/mysql-test/r/variables.result
> > index fef3e4a..e46e65f 100644
> > --- a/mysql-test/r/variables.result
> > +++ b/mysql-test/r/variables.result
> > @@ -1797,3 +1797,13 @@ select * from
> information_schema.session_variables where variable_name='sql_mode
> >  VARIABLE_NAMEVARIABLE_VALUE
> >  SQL_MODE ANSI_QUOTES
> >  End of 5.5 tests
> > +show variables like 'log_slow%statements';
> > +Variable_nameValue
> > +log_slow_admin_statementsOFF
> > +log_slow_slave_statementsOFF
> > +select * from information_schema.global_variables where variable_name
> like 'log_slow_admin_statements';
> > +VARIABLE_NAMEVARIABLE_VALUE
> > +LOG_SLOW_ADMIN_STATEMENTSOFF
> > +select * from information_schema.global_variables where variable_name
> like 'log_slow_slave_statements';
> > +VARIABLE_NAMEVARIABLE_VALUE
> > +LOG_SLOW_SLAVE_STATEMENTSOFF
>
> You can remove this test.
>
> > diff --git a/mysql-test/suite/rpl/t/rpl_slow_query_log.test
> b/mysql-test/suite/rpl/t/rpl_slow_query_log.test
> > index faf037a..de336fc 100644
> > --- a/mysql-test/suite/rpl/t/rpl_slow_query_log.test
> > +++ b/mysql-test/suite/rpl/t/rpl_slow_query_log.test
> > @@ -299,6 +299,49 @@ if ($master_slow_query == $slave_slow_query)
> >-- echo ### same number of queries in slow log: $master_slow_query
> >  }
> >
> > +-- echo
> 
> > +-- echo  TRUNCATE the slow log then check whether runtime changes of
> > +-- echo  log_slow_slave_statements work without slave restart.
> > +-- echo
> ***

Re: [Maria-developers] 72b709a: MDEV-9701: CREATE VIEW with GROUP BY or ORDER BY and constant produces invalid definition

2016-03-18 Thread Sergei Golubchik
Hi, Sanja!

On Mar 16, OleksandrByelkin wrote:
> revision-id: 72b709ac7503ae6dd2b5e9049322fefb90b0ebbe 
> (mariadb-10.1.12-16-g72b709a)
> parent(s): 9b53d84d14a9b031d193f6beae382a232aa738e3
> committer: Oleksandr Byelkin
> timestamp: 2016-03-16 19:49:17 +0100
> message:
> 
> MDEV-9701: CREATE VIEW with GROUP BY or ORDER BY and constant produces 
> invalid definition
> 
> Fixed printing integer constant in the ORDER clause (MySQL solution)
> Removed workaround for double resolving counter in the ORDER.
> 
> ---
>  mysql-test/r/view.result | 19 +++
>  mysql-test/t/view.test   | 17 +
>  sql/sql_lex.cc   | 32 
>  sql/sql_select.cc|  6 +-
>  sql/sql_union.cc | 11 +++
>  5 files changed, 64 insertions(+), 21 deletions(-)
> 
> diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
> index 8ee72c3..d4a2a9b 100644
> diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
> index fd84109..31fc5f9 100644
> --- a/sql/sql_lex.cc
> +++ b/sql/sql_lex.cc
> @@ -2689,30 +2689,22 @@ void st_select_lex::print_order(String *str,
>{
>  if (order->counter_used)
>  {
> -  if (!(query_type & QT_VIEW_INTERNAL))
> -  {
>  char buffer[20];
>  size_t length= my_snprintf(buffer, 20, "%d", order->counter);
>  str->append(buffer, (uint) length);

you can replace these three lines with

   str->append_ulonglong(order->counter);

>}
>else
>{
> -  /* replace numeric reference with expression */
> +  /* replace numeric reference with equivalent for ORDER constant */
>  if (order->item[0]->type() == Item::INT_ITEM &&
>  order->item[0]->basic_const_item())
>  {
> -  char buffer[20];
> -  size_t length= my_snprintf(buffer, 20, "%d", order->counter);
> -  str->append(buffer, (uint) length);
>/* make it expression instead of integer constant */
> -str->append(STRING_WITH_LEN("+0"));
> +str->append(STRING_WITH_LEN("''"));
>  }
>  else
>(*order->item)->print(str, query_type);
>}
> -}
> -else
> -  (*order->item)->print(str, query_type);
>  if (!order->asc)
>str->append(STRING_WITH_LEN(" desc"));
>  if (order->next)
> diff --git a/sql/sql_select.cc b/sql/sql_select.cc
> index fff24b9..f14e8b1 100644
> --- a/sql/sql_select.cc
> +++ b/sql/sql_select.cc
> @@ -21874,7 +21874,11 @@ find_order_in_list(THD *thd, Item 
> **ref_pointer_array, TABLE_LIST *tables,
>*/
>if (order_item->type() == Item::INT_ITEM && order_item->basic_const_item())
>{  /* Order by position */
> -uint count= (uint) order_item->val_int();
> +uint count;
> +if (order->counter_used)

how can this happen?

> +  count= order->counter; // counter was once resolved
> +else
> +  count= (uint) order_item->val_int();
>  if (!count || count > fields.elements)
>  {
>my_error(ER_BAD_FIELD_ERROR, MYF(0),
> diff --git a/sql/sql_union.cc b/sql/sql_union.cc
> index c835083..8145cec 100644
> --- a/sql/sql_union.cc
> +++ b/sql/sql_union.cc
> @@ -1161,11 +1161,22 @@ List 
> *st_select_lex_unit::get_unit_column_types()
>return &sl->item_list;
>  }
>  
> +
> +static void cleanup_order(ORDER *order)
> +{
> +  for (; order; order= order->next)
> +order->counter_used= 0;
> +}
> +
> +
>  bool st_select_lex::cleanup()
>  {
>bool error= FALSE;
>DBUG_ENTER("st_select_lex::cleanup()");
>  
> +  cleanup_order(order_list.first);
> +  cleanup_order(group_list.first);

why is it needed?

>if (join)
>{
>  DBUG_ASSERT((st_select_lex*)join->select_lex == this);

Regards,
Sergei
Chief Architect MariaDB
and secur...@mariadb.org

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] Aggregate stored functions [MDEV-7773]

2016-03-18 Thread Varun Gupta
Hi Sergei,
I have gone through the code you suggested. I have got a good understanding
of what the code actually does. So now I wanted to start writing the
proposal for the idea. Can you tell me what all is needed to written in the
proposal. I am asking for a template or something that could guide me to
write the proposal.

Regards,
Varun
___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] bf2eaa7: MDEV-9382: After updating mariadb server apt-configure fails

2016-03-18 Thread Nirbhay Choubey
Hi Jean,

On Wed, Mar 16, 2016 at 4:48 PM, Jean Weisbuch  wrote:

> I forgot to create the PR for upstream as i did for Otto's repo :
> https://github.com/ottok/mariadb-10.0/pull/26 and
> https://github.com/ottok/mariadb-10.0/pull/27
> These changes are already in Debian testing packages, should i create the
> PR or you will handle it on your side?
>

I have just committed a patch.

Best,
Nirbhay


>
> Le 16/03/2016 20:02, Sergei Golubchik a écrit :
>
>> This doesn't fix much. Next time somebody will need 61 second and you'll
>> adjust to 120?  SST might take many minutes and it's not a good idea to
>> have every user wait this long.
>>
>> Instead you should do what MDEV-8509 says. Add a line like
>>
>>[ -r /etc/default/mariadb ] && . /etc/default/mariadb
>>
>> then one can have a very personal setting of MYSQLD_STARTUP_TIMEOUT
>> in /etc/default/mariadb
>>
>
> ___
> Mailing list: https://launchpad.net/~maria-developers
> Post to : maria-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~maria-developers
> More help   : https://help.launchpad.net/ListHelp
>
___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] NO PAD Collation for MariaDB

2016-03-18 Thread Alexander Barkov
Hello Melisa,

On 03/16/2016 10:22 PM, Melissa Rose wrote:
> Thanks for the kind response Alexander Barkov: I have already build the 
> Server from source and I am looking at some character sets in string/*.c 
> files and how they are implemented.

Excellent.

> I have also written and submitted a draft proposal on the summerofcode  
> website.
> Please I would appreciate if anyone could go through it and leave comments so 
> that I can make any  necessary corrections.

Looks good.

Note, I just added new sections "Testing" and "Proposed development
order" to https://jira.mariadb.org/browse/MDEV-9711 to help you
with diving into the task easier.

Please have a look and update your proposal if needed (e.g. the part
regarding the tentative week schedule will possibly change).

Thanks.

> 
> Thanks, 
> Melisa.
> 

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] 72b709a: MDEV-9701: CREATE VIEW with GROUP BY or ORDER BY and constant produces invalid definition

2016-03-18 Thread Oleksandr Byelkin

Hi!

On 16.03.2016 20:42, Sergei Golubchik wrote:

Hi, Sanja!

On Mar 16, OleksandrByelkin wrote:

revision-id: 72b709ac7503ae6dd2b5e9049322fefb90b0ebbe 
(mariadb-10.1.12-16-g72b709a)
parent(s): 9b53d84d14a9b031d193f6beae382a232aa738e3
committer: Oleksandr Byelkin
timestamp: 2016-03-16 19:49:17 +0100
message:

MDEV-9701: CREATE VIEW with GROUP BY or ORDER BY and constant produces invalid 
definition

Fixed printing integer constant in the ORDER clause (MySQL solution)
Removed workaround for double resolving counter in the ORDER.

---
  mysql-test/r/view.result | 19 +++
  mysql-test/t/view.test   | 17 +
  sql/sql_lex.cc   | 32 
  sql/sql_select.cc|  6 +-
  sql/sql_union.cc | 11 +++
  5 files changed, 64 insertions(+), 21 deletions(-)

diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 8ee72c3..d4a2a9b 100644
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index fd84109..31fc5f9 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -2689,30 +2689,22 @@ void st_select_lex::print_order(String *str,
{
  if (order->counter_used)
  {
-  if (!(query_type & QT_VIEW_INTERNAL))
-  {
  char buffer[20];
  size_t length= my_snprintf(buffer, 20, "%d", order->counter);
  str->append(buffer, (uint) length);

you can replace these three lines with

str->append_ulonglong(order->counter);

OK!



}
else
{
-  /* replace numeric reference with expression */
+  /* replace numeric reference with equivalent for ORDER constant */
  if (order->item[0]->type() == Item::INT_ITEM &&
  order->item[0]->basic_const_item())
  {
-  char buffer[20];
-  size_t length= my_snprintf(buffer, 20, "%d", order->counter);
-  str->append(buffer, (uint) length);
/* make it expression instead of integer constant */
-str->append(STRING_WITH_LEN("+0"));
+str->append(STRING_WITH_LEN("''"));
  }
  else
(*order->item)->print(str, query_type);
}
-}
-else
-  (*order->item)->print(str, query_type);
  if (!order->asc)
str->append(STRING_WITH_LEN(" desc"));
  if (order->next)
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index fff24b9..f14e8b1 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -21874,7 +21874,11 @@ find_order_in_list(THD *thd, Item **ref_pointer_array, 
TABLE_LIST *tables,
*/
if (order_item->type() == Item::INT_ITEM && order_item->basic_const_item())
{   /* Order by position */
-uint count= (uint) order_item->val_int();
+uint count;
+if (order->counter_used)

how can this happen?
we merge view and so its ORDER BY first we resolve it in  view then in 
outer query. It actually works (I am not sure if I should include also 
following test:


create table t1 (a int, b int);
insert into t1 values (1,2), (2,1);
create view v1 as select a, b from t1 order by 1;
select b,a from v1;
ba
21
12
select a,b from v1;
ab
12
21
prepare stmt from "select b,a from v1";
execute stmt;
ba
21
12
execute stmt;
ba
21
12
prepare stmt from "select a,b from v1";
execute stmt;
ab
12
21
execute stmt;
ab
12
21
drop view v1;
drop table t1;


Actually I can make above even more efficient, just exit in case if 
resolving already done. Try it?



+  count= order->counter; // counter was once resolved
+else
+  count= (uint) order_item->val_int();
  if (!count || count > fields.elements)
  {
my_error(ER_BAD_FIELD_ERROR, MYF(0),
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index c835083..8145cec 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -1161,11 +1161,22 @@ List *st_select_lex_unit::get_unit_column_types()
return &sl->item_list;
  }
  
+

+static void cleanup_order(ORDER *order)
+{
+  for (; order; order= order->next)
+order->counter_used= 0;
+}
+
+
  bool st_select_lex::cleanup()
  {
bool error= FALSE;
DBUG_ENTER("st_select_lex::cleanup()");
  
+  cleanup_order(order_list.first);

+  cleanup_order(group_list.first);

why is it needed?
For PS and exactly for PS  with "ORDER BY ?" to make new resolving for 
re-execution.

if (join)
{
  DBUG_ASSERT((st_select_lex*)join->select_lex == this);

Regards,
Sergei
Chief Architect MariaDB
and secur...@mariadb.org

___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp



___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https: