~ubuntu-branches/ubuntu/utopic/mariadb-5.5/utopic-security

« back to all changes in this revision

Viewing changes to sql/sql_udf.cc

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen, Otto Kekäläinen, James Page
  • Date: 2014-03-02 01:38:26 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140302013826-z3afnfteqo86pccd
[ Otto Kekäläinen ]
* New upstream release.
* Updated Danish debconf translation (Closes: #739750).
* d/control: Added explicit Conflicts/Replaces for mysql-5.6 packages
  (Closes: #739841).
* d/control: Update for use of virtual-* packages for switching to/from
  MySQL alternatives.

[ James Page ]
* d/control: Drop Nicholas from Uploaders, MIA (Closes: #739360).
* d/control: Add libjemalloc-dev to BD's.

Show diffs side-by-side

added added

removed removed

Lines of Context:
352
352
  if (!initialized)
353
353
    DBUG_RETURN(NULL);
354
354
 
 
355
  DEBUG_SYNC(current_thd, "find_udf_before_lock");
355
356
  /* TODO: This should be changed to reader locks someday! */
356
357
  if (mark_used)
357
358
    mysql_rwlock_wrlock(&THR_LOCK_udf);  /* Called during fix_fields */
466
467
  if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row()))
467
468
    thd->clear_current_stmt_binlog_format_row();
468
469
 
 
470
  tables.init_one_table(STRING_WITH_LEN("mysql"), STRING_WITH_LEN("func"),
 
471
                        "func", TL_WRITE);
 
472
  table= open_ltable(thd, &tables, TL_WRITE, MYSQL_LOCK_IGNORE_TIMEOUT);
 
473
 
469
474
  mysql_rwlock_wrlock(&THR_LOCK_udf);
 
475
  DEBUG_SYNC(current_thd, "mysql_create_function_after_lock");
470
476
  if ((my_hash_search(&udf_hash,(uchar*) udf->name.str, udf->name.length)))
471
477
  {
472
478
    my_error(ER_UDF_EXISTS, MYF(0), udf->name.str);
510
516
 
511
517
  /* create entry in mysql.func table */
512
518
 
513
 
  tables.init_one_table("mysql", 5, "func", 4, "func", TL_WRITE);
514
519
  /* Allow creation of functions even if we can't open func table */
515
 
  if (!(table = open_ltable(thd, &tables, TL_WRITE, MYSQL_LOCK_IGNORE_TIMEOUT)))
 
520
  if (!table)
516
521
    goto err;
517
522
  table->use_all_columns();
518
523
  restore_record(table, s->default_values);     // Default values for fields
584
589
  if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row()))
585
590
    thd->clear_current_stmt_binlog_format_row();
586
591
 
 
592
  tables.init_one_table(STRING_WITH_LEN("mysql"), STRING_WITH_LEN("func"),
 
593
                        "func", TL_WRITE);
 
594
  table= open_ltable(thd, &tables, TL_WRITE, MYSQL_LOCK_IGNORE_TIMEOUT);
 
595
 
587
596
  mysql_rwlock_wrlock(&THR_LOCK_udf);
 
597
  DEBUG_SYNC(current_thd, "mysql_drop_function_after_lock");
588
598
  if (!(udf=(udf_func*) my_hash_search(&udf_hash,(uchar*) udf_name->str,
589
599
                                       (uint) udf_name->length)))
590
600
  {
601
611
  if (udf->dlhandle && !find_udf_dl(udf->dl))
602
612
    dlclose(udf->dlhandle);
603
613
 
604
 
  tables.init_one_table("mysql", 5, "func", 4, "func", TL_WRITE);
605
 
 
606
 
  if (!(table = open_ltable(thd, &tables, TL_WRITE, MYSQL_LOCK_IGNORE_TIMEOUT)))
 
614
  if (!table)
607
615
    goto err;
608
616
  table->use_all_columns();
609
617
  table->field[0]->store(exact_name_str, exact_name_len, &my_charset_bin);