Skip to content

Instantly share code, notes, and snippets.

View kevgs's full-sized avatar
🏠
Working from home

Eugene Kosov kevgs

🏠
Working from home
View GitHub Profile
class PMutex
{
pthread_mutex_t mutex_;
public:
using native_handle_type= pthread_mutex_t &;
PMutex()
{
pthread_mutexattr_t attr;
commit 2f1a5232e4bb97412ca726ce70e104786eff7064
Author: Eugene Kosov <[email protected]>
Date: Wed Jan 8 00:35:02 2020 +0700
let newer compilers use native thread local storage
This should not affect old compilers at all.
But newer ones can use thread_local from C++11 and _Thread_local from C11.
Native TLS is faster than library pthreads implementation.
diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h
index 4808d91e275..a20304b0937 100644
--- a/storage/innobase/include/log0log.h
+++ b/storage/innobase/include/log0log.h
@@ -52,13 +52,11 @@ step which modifies the database, is started */
#define LOG_CHECKPOINT_FREE_PER_THREAD (4U << srv_page_size_shift)
#define LOG_CHECKPOINT_EXTRA_FREE (8U << srv_page_size_shift)
-typedef ulint (*log_checksum_func_t)(const byte* log_block);
-
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <cerrno>
#include <cassert>
#include <cstdlib>
#include <cstring>
diff --git a/mysql-test/suite/innodb/r/instant_alter_charset.result b/mysql-test/suite/innodb/r/instant_alter_charset.result
index 268848f31ec..53814c4712b 100644
--- a/mysql-test/suite/innodb/r/instant_alter_charset.result
+++ b/mysql-test/suite/innodb/r/instant_alter_charset.result
@@ -259,6 +259,52 @@ alter table boundary_255
modify c varchar(300) charset utf8mb3,
algorithm=instant;
drop table boundary_255;
+create table t (
+a char(10) collate utf8mb3_general_ci,
@kevgs
kevgs / 1.diff
Created December 15, 2017 10:30
diff --git a/sql/handler.cc b/sql/handler.cc
index 9d19ede0a70..c8d06114847 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -6843,10 +6843,23 @@ bool Vers_parse_info::fix_implicit(THD *thd, Alter_info *alter_info,
return false;
}
-bool Table_scope_and_contents_source_st::vers_native(THD *thd) const
+bool Table_scope_and_contents_source_st::vers_native(THD *thd, TABLE *table) const
int cgroup_setup_root(struct cgroup_root *root, u16 ss_mask, int ref_flags) {
LIST_HEAD(tmp_links);
struct cgroup *root_cgrp = &root->cgrp;
struct kernfs_syscall_ops *kf_sops;
struct css_set *cset;
int i, ret;
lockdep_assert_held(&cgroup_mutex);
ret = cgroup_idr_alloc(&root->cgroup_idr, root_cgrp, 1, 2, GFP_KERNEL);
void cgroup_setup_root(struct cgroup_root *root, u16 ss_mask, int ref_flags)
{
LIST_HEAD(tmp_links);
struct cgroup *root_cgrp = &root->cgrp;
struct kernfs_syscall_ops *kf_sops;
struct css_set *cset;
int i;
lockdep_assert_held(&cgroup_mutex);
// g++ -std=c++14 -O2 find_missing.cc
// Duration is 2.87698s
// 27341465
// Duration is 0.121498s
// 27341465
#include <algorithm>
#include <chrono>
#include <iostream>
package utils
import (
"bufio"
"bytes"
"database/sql"
_ "github.com/go-sql-driver/mysql"
"io"
"log"
)