Commit a9240dce authored by Alexander Barkov's avatar Alexander Barkov

Merge 10.0-base -> 10.0

parents 2c0a0739 eb2c6f45
......@@ -1153,6 +1153,21 @@ packaging/solaris/postinstall-solaris
extra/jemalloc/jemalloc-*
extra/jemalloc/build
*.tdb
pcre/config.h
pcre/CTestCustom.ctest
pcre/pcre_grep_test.sh
pcre/pcre_scanner_unittest
pcre/pcre_stringpiece_unittest
pcre/pcre_test.sh
pcre/pcrecpp_unittest
pcre/pcregrep
pcre/pcretest
pcre/pcre.h
testNinput
teststderr
testtemp1
testtemp2
testtry
storage/tokudb/ft-index/CTestCustom.cmake
storage/tokudb/ft-index/DartConfiguration.tcl
storage/tokudb/ft-index/ctags-stamp
......
......@@ -306,7 +306,7 @@ ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(dbug)
ADD_SUBDIRECTORY(strings)
ADD_SUBDIRECTORY(vio)
ADD_SUBDIRECTORY(regex)
ADD_SUBDIRECTORY(pcre)
ADD_SUBDIRECTORY(mysys)
ADD_SUBDIRECTORY(mysys_ssl)
ADD_SUBDIRECTORY(libmysql)
......
......@@ -15,11 +15,12 @@
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/pcre
${CMAKE_SOURCE_DIR}/pcre
${CMAKE_SOURCE_DIR}/mysys_ssl
${ZLIB_INCLUDE_DIR}
${SSL_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/libmysql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/strings
${MY_READLINE_INCLUDE_DIR}
......@@ -40,7 +41,7 @@ ENDIF(UNIX)
MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc COMPONENT Test)
SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS")
TARGET_LINK_LIBRARIES(mysqltest mysqlclient regex)
TARGET_LINK_LIBRARIES(mysqltest mysqlclient pcre pcreposix)
SET_TARGET_PROPERTIES(mysqltest PROPERTIES ENABLE_EXPORTS TRUE)
......
......@@ -44,7 +44,8 @@
#include <hash.h>
#include <stdarg.h>
#include <violite.h>
#include "my_regex.h" /* Our own version of regex */
#define PCRE_STATIC 1 /* Important on Windows */
#include "pcreposix.h" /* pcreposix regex library */
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
......@@ -250,12 +251,12 @@ static const char *opt_suite_dir, *opt_overlay_dir;
static size_t suite_dir_len, overlay_dir_len;
/* Precompiled re's */
static my_regex_t ps_re; /* the query can be run using PS protocol */
static my_regex_t sp_re; /* the query can be run as a SP */
static my_regex_t view_re; /* the query can be run as a view*/
static regex_t ps_re; /* the query can be run using PS protocol */
static regex_t sp_re; /* the query can be run as a SP */
static regex_t view_re; /* the query can be run as a view*/
static void init_re(void);
static int match_re(my_regex_t *, char *);
static int match_re(regex_t *, char *);
static void free_re(void);
static char *get_string(char **to_ptr, char **from_ptr,
......@@ -7254,13 +7255,13 @@ void str_to_file(const char *fname, char *str, int size)
}
void check_regerr(my_regex_t* r, int err)
void check_regerr(regex_t* r, int err)
{
char err_buf[1024];
if (err)
{
my_regerror(err,r,err_buf,sizeof(err_buf));
regerror(err,r,err_buf,sizeof(err_buf));
die("Regex error: %s\n", err_buf);
}
}
......@@ -8552,19 +8553,18 @@ char *re_eprint(int err)
{
static char epbuf[100];
size_t len __attribute__((unused))=
my_regerror(REG_ITOA|err, (my_regex_t *)NULL, epbuf, sizeof(epbuf));
regerror(REG_ITOA|err, (regex_t *)NULL, epbuf, sizeof(epbuf));
assert(len <= sizeof(epbuf));
return(epbuf);
}
void init_re_comp(my_regex_t *re, const char* str)
void init_re_comp(regex_t *re, const char* str)
{
int err= my_regcomp(re, str, (REG_EXTENDED | REG_ICASE | REG_NOSUB),
&my_charset_latin1);
int err= regcomp(re, str, (REG_EXTENDED | REG_ICASE | REG_NOSUB | REG_DOTALL));
if (err)
{
char erbuf[100];
int len= my_regerror(err, re, erbuf, sizeof(erbuf));
int len= regerror(err, re, erbuf, sizeof(erbuf));
die("error %s, %d/%d `%s'\n",
re_eprint(err), (int)len, (int)sizeof(erbuf), erbuf);
}
......@@ -8609,7 +8609,7 @@ void init_re(void)
}
int match_re(my_regex_t *re, char *str)
int match_re(regex_t *re, char *str)
{
while (my_isspace(charset_info, *str))
str++;
......@@ -8621,7 +8621,7 @@ int match_re(my_regex_t *re, char *str)
str= comm_end + 2;
}
int err= my_regexec(re, str, (size_t)0, NULL, 0);
int err= regexec(re, str, (size_t)0, NULL, 0);
if (err == 0)
return 1;
......@@ -8630,7 +8630,7 @@ int match_re(my_regex_t *re, char *str)
{
char erbuf[100];
int len= my_regerror(err, re, erbuf, sizeof(erbuf));
int len= regerror(err, re, erbuf, sizeof(erbuf));
die("error %s, %d/%d `%s'\n",
re_eprint(err), (int)len, (int)sizeof(erbuf), erbuf);
}
......@@ -8639,10 +8639,9 @@ int match_re(my_regex_t *re, char *str)
void free_re(void)
{
my_regfree(&ps_re);
my_regfree(&sp_re);
my_regfree(&view_re);
my_regex_end();
regfree(&ps_re);
regfree(&sp_re);
regfree(&view_re);
}
/****************************************************************************/
......@@ -10081,13 +10080,13 @@ void free_replace_regex()
int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
char *replace, char *string, int icase)
{
my_regex_t r;
my_regmatch_t *subs;
regex_t r;
regmatch_t *subs;
char *replace_end;
char *buf= *buf_p;
int len;
int buf_len, need_buf_len;
int cflags= REG_EXTENDED;
int cflags= REG_EXTENDED | REG_DOTALL;
int err_code;
char *res_p,*str_p,*str_end;
......@@ -10106,13 +10105,13 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
if (icase)
cflags|= REG_ICASE;
if ((err_code= my_regcomp(&r,pattern,cflags,&my_charset_latin1)))
if ((err_code= regcomp(&r,pattern,cflags)))
{
check_regerr(&r,err_code);
return 1;
}
subs= (my_regmatch_t*)my_malloc(sizeof(my_regmatch_t) * (r.re_nsub+1),
subs= (regmatch_t*)my_malloc(sizeof(regmatch_t) * (r.re_nsub+1),
MYF(MY_WME+MY_FAE));
*res_p= 0;
......@@ -10123,14 +10122,14 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
while (!err_code)
{
/* find the match */
err_code= my_regexec(&r,str_p, r.re_nsub+1, subs,
err_code= regexec(&r,str_p, r.re_nsub+1, subs,
(str_p == string) ? REG_NOTBOL : 0);
/* if regular expression error (eg. bad syntax, or out of memory) */
if (err_code && err_code != REG_NOMATCH)
{
check_regerr(&r,err_code);
my_regfree(&r);
regfree(&r);
return 1;
}
......@@ -10243,7 +10242,7 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
}
}
my_free(subs);
my_regfree(&r);
regfree(&r);
*res_p= 0;
*buf_p= buf;
*buf_len_p= buf_len;
......
......@@ -24,9 +24,10 @@
# ADD_DEFINITIONS(-DHAVE_BROKEN_REALPATH)
# Find libexecinfo (library that contains backtrace_symbols etc)
INCLUDE_DIRECTORIES(/usr/local/include)
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} /usr/local/include )
SET(ENV{LIB} "$ENV{LIB}:/usr/local/lib")
SET(EXECINFO_ROOT /usr/local CACHE INTERNAL "Where to find execinfo library and header")
INCLUDE_DIRECTORIES(${EXECINFO_ROOT}/include)
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${EXECINFO_ROOT}/include)
SET(ENV{LIB} "$ENV{LIB}:${EXECINFO_ROOT}/lib")
FIND_LIBRARY(EXECINFO NAMES execinfo)
IF(EXECINFO)
SET(LIBEXECINFO ${EXECINFO})
......
......@@ -54,7 +54,8 @@ MACRO(MYSQL_ADD_PLUGIN)
# Add common include directories
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_BINARY_DIR}/pcre
${CMAKE_SOURCE_DIR}/pcre
${SSL_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR})
......
......@@ -16,7 +16,8 @@
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/libmysql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_BINARY_DIR}/pcre
${CMAKE_SOURCE_DIR}/pcre
${CMAKE_SOURCE_DIR}/strings
${SSL_INCLUDE_DIRS}
${SSL_INTERNAL_INCLUDE_DIRS}
......
......@@ -22,7 +22,8 @@ ${CMAKE_SOURCE_DIR}/libmysql
${CMAKE_SOURCE_DIR}/libmysqld
${CMAKE_SOURCE_DIR}/sql
${CMAKE_BINARY_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_BINARY_DIR}/pcre
${CMAKE_SOURCE_DIR}/pcre
${ZLIB_INCLUDE_DIR}
${SSL_INCLUDE_DIRS}
${SSL_INTERNAL_INCLUDE_DIRS}
......@@ -122,7 +123,7 @@ ENDIF()
SET(LIBS
dbug strings regex mysys mysys_ssl vio
dbug strings mysys mysys_ssl pcre vio
${ZLIB_LIBRARY} ${SSL_LIBRARIES}
${LIBWRAP} ${LIBCRYPT} ${LIBDL}
${MYSQLD_STATIC_PLUGIN_LIBS}
......
......@@ -15,7 +15,8 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/libmysqld/include
${CMAKE_SOURCE_DIR}/regex
${CMAKE_BINARY_DIR}/pcre
${CMAKE_SOURCE_DIR}/pcre
${CMAKE_SOURCE_DIR}/sql
${MY_READLINE_INCLUDE_DIR}
)
......@@ -34,7 +35,7 @@ ENDIF(UNIX)
MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc
COMPONENT Test)
TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver)
TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver pcre pcreposix)
IF(CMAKE_GENERATOR MATCHES "Xcode")
# It does not seem possible to tell Xcode the resulting target might need
......
......@@ -416,11 +416,13 @@ int emb_unbuffered_fetch(MYSQL *mysql, char **row)
static void emb_free_embedded_thd(MYSQL *mysql)
{
THD *thd= (THD*)mysql->thd;
mysql_mutex_lock(&LOCK_thread_count);
thd->clear_data_list();
thread_count--;
thd->store_globals();
thd->unlink();
delete thd;
mysql_mutex_unlock(&LOCK_thread_count);
my_pthread_setspecific_ptr(THR_THD, 0);
mysql->thd=0;
}
......@@ -687,8 +689,10 @@ void *create_embedded_thd(int client_flag)
thd->data_tail= &thd->first_data;
bzero((char*) &thd->net, sizeof(thd->net));
mysql_mutex_lock(&LOCK_thread_count);
thread_count++;
threads.append(thd);
mysql_mutex_unlock(&LOCK_thread_count);
thd->mysys_var= 0;
return thd;
err:
......
......@@ -234,15 +234,15 @@ set names utf8mb4;
set names utf8mb4;
# This should return TRUE
select 'вася' rlike '[[:<:]]вася[[:>:]]';
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
select ' вася' rlike '[[:<:]]вася[[:>:]]';
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
select 'вася' rlike '\\bвася\\b';
select 'вася ' rlike '\\bвася\\b';
select ' вася' rlike '\\bвася\\b';
select ' вася ' rlike '\\bвася\\b';
# This should return FALSE
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
select 'васяz' rlike '\\bвася\\b';
select 'zвася' rlike '\\bвася\\b';
select 'zвасяz' rlike '\\bвася\\b';
#
# Bug #4555
......
......@@ -94,7 +94,7 @@ while ($_show_slave_status_items)
--replace_regex /\.[\\\/]master/master/
--let $_show_slave_status_value= query_get_value(SHOW SLAVE STATUS, $_show_slave_status_name, 1)
--let $_slave_field_result_replace= /[\\]/\// $slave_field_result_replace
--let $_slave_field_result_replace= /[\\\\]/\// $slave_field_result_replace
--replace_regex $_slave_field_result_replace
--let $_show_slave_status_value= `SELECT REPLACE("$_show_slave_status_value", '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')`
--echo $_show_slave_status_name = '$_show_slave_status_value'
......
......@@ -316,26 +316,26 @@ NULL
drop table t1;
set names utf8;
set names utf8;
select 'вася' rlike '[[:<:]]вася[[:>:]]';
'вася' rlike '[[:<:]]вася[[:>:]]'
select 'вася' rlike '\\bвася\\b';
'вася' rlike '\\bвася\\b'
1
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
'вася ' rlike '[[:<:]]вася[[:>:]]'
select 'вася ' rlike '\\bвася\\b';
'вася ' rlike '\\bвася\\b'
1
select ' вася' rlike '[[:<:]]вася[[:>:]]';
' вася' rlike '[[:<:]]вася[[:>:]]'
select ' вася' rlike '\\bвася\\b';
' вася' rlike '\\bвася\\b'
1
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
' вася ' rlike '[[:<:]]вася[[:>:]]'
select ' вася ' rlike '\\bвася\\b';
' вася ' rlike '\\bвася\\b'
1
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
'васяz' rlike '[[:<:]]вася[[:>:]]'
select 'васяz' rlike '\\bвася\\b';
'васяz' rlike '\\bвася\\b'
0
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
'zвася' rlike '[[:<:]]вася[[:>:]]'
select 'zвася' rlike '\\bвася\\b';
'zвася' rlike '\\bвася\\b'
0
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
select 'zвасяz' rlike '\\bвася\\b';
'zвасяz' rlike '\\bвася\\b'
0
CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8_unicode_ci);
ALTER TABLE t1 ADD COLUMN b CHAR(20);
......
......@@ -316,26 +316,26 @@ NULL
drop table t1;
set names utf8mb4;
set names utf8mb4;
select 'вася' rlike '[[:<:]]вася[[:>:]]';
'вася' rlike '[[:<:]]вася[[:>:]]'
select 'вася' rlike '\\bвася\\b';
'вася' rlike '\\bвася\\b'
1
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
'вася ' rlike '[[:<:]]вася[[:>:]]'
select 'вася ' rlike '\\bвася\\b';
'вася ' rlike '\\bвася\\b'
1
select ' вася' rlike '[[:<:]]вася[[:>:]]';
' вася' rlike '[[:<:]]вася[[:>:]]'
select ' вася' rlike '\\bвася\\b';
' вася' rlike '\\bвася\\b'
1
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
' вася ' rlike '[[:<:]]вася[[:>:]]'
select ' вася ' rlike '\\bвася\\b';
' вася ' rlike '\\bвася\\b'
1
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
'васяz' rlike '[[:<:]]вася[[:>:]]'
select 'васяz' rlike '\\bвася\\b';
'васяz' rlike '\\bвася\\b'
0
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
'zвася' rlike '[[:<:]]вася[[:>:]]'
select 'zвася' rlike '\\bвася\\b';
'zвася' rlike '\\bвася\\b'
0
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
select 'zвасяz' rlike '\\bвася\\b';
'zвасяz' rlike '\\bвася\\b'
0
CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8mb4_unicode_ci);
ALTER TABLE t1 ADD COLUMN b CHAR(20);
......
......@@ -306,26 +306,26 @@ NULL
drop table t1;
set names utf8mb4;
set names utf8mb4;
select 'вася' rlike '[[:<:]]вася[[:>:]]';
'вася' rlike '[[:<:]]вася[[:>:]]'
select 'вася' rlike '\\bвася\\b';
'вася' rlike '\\bвася\\b'
1
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
'вася ' rlike '[[:<:]]вася[[:>:]]'
select 'вася ' rlike '\\bвася\\b';
'вася ' rlike '\\bвася\\b'
1
select ' вася' rlike '[[:<:]]вася[[:>:]]';
' вася' rlike '[[:<:]]вася[[:>:]]'
select ' вася' rlike '\\bвася\\b';
' вася' rlike '\\bвася\\b'
1
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
' вася ' rlike '[[:<:]]вася[[:>:]]'
select ' вася ' rlike '\\bвася\\b';
' вася ' rlike '\\bвася\\b'
1
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
'васяz' rlike '[[:<:]]вася[[:>:]]'
select 'васяz' rlike '\\bвася\\b';
'васяz' rlike '\\bвася\\b'
0
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
'zвася' rlike '[[:<:]]вася[[:>:]]'
select 'zвася' rlike '\\bвася\\b';
'zвася' rlike '\\bвася\\b'
0
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
select 'zвасяz' rlike '\\bвася\\b';
'zвасяz' rlike '\\bвася\\b'
0
CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8mb4_unicode_ci) ENGINE heap;
ALTER TABLE t1 ADD COLUMN b CHAR(20);
......
......@@ -316,26 +316,26 @@ NULL
drop table t1;
set names utf8mb4;
set names utf8mb4;
select 'вася' rlike '[[:<:]]вася[[:>:]]';
'вася' rlike '[[:<:]]вася[[:>:]]'
select 'вася' rlike '\\bвася\\b';
'вася' rlike '\\bвася\\b'
1
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
'вася ' rlike '[[:<:]]вася[[:>:]]'
select 'вася ' rlike '\\bвася\\b';
'вася ' rlike '\\bвася\\b'
1
select ' вася' rlike '[[:<:]]вася[[:>:]]';
' вася' rlike '[[:<:]]вася[[:>:]]'
select ' вася' rlike '\\bвася\\b';
' вася' rlike '\\bвася\\b'
1
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
' вася ' rlike '[[:<:]]вася[[:>:]]'
select ' вася ' rlike '\\bвася\\b';
' вася ' rlike '\\bвася\\b'
1
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
'васяz' rlike '[[:<:]]вася[[:>:]]'
select 'васяz' rlike '\\bвася\\b';
'васяz' rlike '\\bвася\\b'
0
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
'zвася' rlike '[[:<:]]вася[[:>:]]'
select 'zвася' rlike '\\bвася\\b';
'zвася' rlike '\\bвася\\b'
0
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
select 'zвасяz' rlike '\\bвася\\b';
'zвасяz' rlike '\\bвася\\b'
0
CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8mb4_unicode_ci) ENGINE InnoDB;
ALTER TABLE t1 ADD COLUMN b CHAR(20);
......
......@@ -316,26 +316,26 @@ NULL
drop table t1;
set names utf8mb4;
set names utf8mb4;
select 'вася' rlike '[[:<:]]вася[[:>:]]';
'вася' rlike '[[:<:]]вася[[:>:]]'
select 'вася' rlike '\\bвася\\b';
'вася' rlike '\\bвася\\b'
1
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
'вася ' rlike '[[:<:]]вася[[:>:]]'
select 'вася ' rlike '\\bвася\\b';
'вася ' rlike '\\bвася\\b'
1
select ' вася' rlike '[[:<:]]вася[[:>:]]';
' вася' rlike '[[:<:]]вася[[:>:]]'
select ' вася' rlike '\\bвася\\b';
' вася' rlike '\\bвася\\b'
1
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
' вася ' rlike '[[:<:]]вася[[:>:]]'
select ' вася ' rlike '\\bвася\\b';
' вася ' rlike '\\bвася\\b'
1
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
'васяz' rlike '[[:<:]]вася[[:>:]]'
select 'васяz' rlike '\\bвася\\b';
'васяz' rlike '\\bвася\\b'
0
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
'zвася' rlike '[[:<:]]вася[[:>:]]'
select 'zвася' rlike '\\bвася\\b';
'zвася' rlike '\\bвася\\b'
0
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
select 'zвасяz' rlike '\\bвася\\b';
'zвасяz' rlike '\\bвася\\b'
0
CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8mb4_unicode_ci) ENGINE MyISAM;
ALTER TABLE t1 ADD COLUMN b CHAR(20);
......
......@@ -2215,6 +2215,35 @@ DROP VIEW v1;
DROP TABLE t1,t2;
set optimizer_switch=@save_optimizer_switch;
#
# mdev-5078: sum over a view/derived table
#
CREATE TABLE t1 (a int);
INSERT INTO t1 (a) VALUES (1), (2);
CREATE TABLE t2 (b int(11));
INSERT INTO t2 (b) VALUES (1), (2);
CREATE VIEW v AS SELECT b as c FROM t2;
SELECT a, (SELECT SUM(a + c) FROM v) FROM t1;
a (SELECT SUM(a + c) FROM v)
1 5
2 7
SELECT a, (SELECT SUM(a + c) FROM (SELECT b as c FROM t2) AS v1) FROM t1;
a (SELECT SUM(a + c) FROM (SELECT b as c FROM t2) AS v1)
1 5
2 7
DROP VIEW v;
DROP TABLE t1,t2;
#
# mdev-5105: memory overwrite in multi-table update
# using natuaral join with a view
#
create table t1(a int,b tinyint,c tinyint)engine=myisam;
create table t2(a tinyint,b float,c int, d int, e int, f int, key (b), key(c), key(d), key(e), key(f))engine=myisam;
create table t3(a int,b int,c int, d int, e int, f int, key(a), key(b), key(c), key(d), key(e), key(f))engine=myisam;
create view v1 as select t2.b a, t1.b b, t2.c c, t2.d d, t2.e e, t2.f f from t1,t2 where t1.a=t2.a;
update t3 natural join v1 set a:=1;
drop view v1;
drop table t1,t2,t3;
#
# end of 5.3 tests
#
set optimizer_switch=@exit_optimizer_switch;
......
......@@ -879,6 +879,116 @@ NULL
7
drop view v;
drop table t1, t2;
CREATE TABLE t1 (
id int, i1 int, i2 int DEFAULT 0,
d1 date DEFAULT '2000-01-01', d2 date DEFAULT '2000-01-01',
t1 time DEFAULT '00:00:00', t2 time DEFAULT '00:00:00',
dt1 datetime NOT NULL DEFAULT '2000-01-01 00:00:00',
dt2 datetime NOT NULL DEFAULT '2000-01-01 00:00:00',
c1 varchar(1) NOT NULL, c2 varchar(1) NOT NULL
) ENGINE=MyISAM;
CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 (id,i1,c1,c2) VALUES
(1,7,'t','t'),(2,4,'k','k'),(3,2,'e','e'),(4,0,'i','i'),(5,1,'t','t'),(6,91,'m','m'),
(7,6,'z','z'),(8,3,'c','c'),(9,6,'i','i'),(10,8,'v','v'), (11,1,'l','l'),(12,4,'j','j'),
(13,5,'w','w'),(14,0,'r','r'),(15,7,'o','o'),(16,9,'o','o'),(17,7,'u','u'),(18,6,'f','f'),
(19,0,'l','l'),(20,6,'g','g'),(21,1,'e','e'),(22,7,'y','y'),(23,0,'p','p'),(24,6,'v','v'),
(25,5,'d','d'),(26,9,'i','i'),(27,5,'z','z'),(28,2,'q','q'),(29,4,'j','j'),(30,9,'m','m'),
(31,8,'d','d'),(32,5,'r','r'),(33,1,'r','r'),(34,1,'k','k'),(35,4,'p','p'),(36,2,'x','x'),
(37,5,'w','w'),(38,0,'k','k'),(39,7,'y','y'),(40,4,'p','p'),(41,9,'l','l'),(42,2,'u','u'),
(43,3,'r','r'),(44,5,'y','y'),(45,3,'u','u'),(46,9,'t','t'),(47,8,'f','f'),(48,2,'f','f'),
(49,2,'q','q'),(50,6,'v','v'),(51,6,'u','u'),(52,0,'b','b'),(53,1,'n','n'),(54,2,'p','p'),
(55,0,'y','y'),(56,1,'l','l'),(57,1,'c','c'),(58,0,'d','d'),(59,2,'y','y'),(60,7,'l','l'),
(61,6,'m','m'),(62,9,'q','q'),(63,0,'j','j'),(64,3,'u','u'),(65,4,'w','w'),(66,5,'p','p'),
(67,8,'z','z'),(68,5,'u','u'),(69,7,'b','b'),(70,0,'f','f'),(71,6,'u','u'),(72,1,'i','i'),
(73,9,'s','s'),(74,3,'y','y'),(75,5,'s','s'),(76,8,'x','x'),(77,3,'s','s'),(78,3,'l','l'),
(79,8,'b','b'),(80,0,'p','p'),(81,9,'m','m'),(82,5,'k','k'),(83,7,'u','u'),(84,0,'y','y'),
(85,2,'x','x'),(86,5,'h','h'),(87,5,'j','j'),(88,5,'o','o'),(89,9,'o','o'),(90,1,'c','c'),
(91,7,'k','k'),(92,9,'t','t'),(93,3,'h','h'),(94,6,'g','g'),(95,9,'r','r'),(96,2,'i','i');
CREATE TABLE t2 (i INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (7),(8);
SELECT STRAIGHT_JOIN COUNT(DISTINCT t1.id) FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
COUNT(DISTINCT t1.id)
18
EXPLAIN EXTENDED
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 96 100.00 Using where; Using temporary
1 PRIMARY <derived2> ref key0 key0 5 test.t1.i1 9 100.00 Using where; Distinct
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Distinct; Using join buffer (flat, BNL join)
2 DERIVED t1 ALL NULL NULL NULL NULL 96 100.00
Warnings:
Note 1003 select straight_join distinct `test`.`t1`.`id` AS `id` from `test`.`t1` join `test`.`v1` join `test`.`t2` where ((`test`.`t2`.`i` = `v1`.`id`) and (`v1`.`i1` = `test`.`t1`.`i1`) and (`v1`.`id` <> 3))
set join_buffer_size=1024;
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
id
7
8
9
18
20
24
43
45
50
51
61
64
71
74
77
78
93
94
set join_buffer_size=1024*16;
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
id
7
9
18
20
24
8
50
51
61
43
45
71
64
74
77
78
94
93
set join_buffer_size=default;
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
id
7
9
18
20
24
50
51
61
71
94
8
43
45
64
74
77
78
93
DROP VIEW v1;
DROP TABLE t1,t2;
#
# Bug #11744875: 4082: integer lengths cause truncation with distinct concat and innodb
#
......
This diff is collapsed.
......@@ -373,3 +373,12 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT * FROM t1 WHERE NOT (concat( dt, '1' ) IS NOT NULL);
dt
DROP TABLE t1;
#
# Bug mdev-5132: crash when exeicuting a join query
# with IS NULL and IS NOT NULL in where
#
CREATE TABLE t1 (a DATE, b INT, c INT, KEY(a), KEY(b), KEY(c)) ENGINE=MyISAM;
CREATE TABLE t2 (d DATE) ENGINE=MyISAM;
SELECT * FROM t1,t2 WHERE 1 IS NOT NULL AND t1.b IS NULL;
a b c d
DROP TABLE t1,t2;
......@@ -1094,6 +1094,21 @@ COUNT(*)
3724
set optimizer_prune_level=@tmp_951283;
DROP TABLE t1,t2;
#
# Bug mdev-5135: crash on semijoin with nested outer joins
#
CREATE TABLE t1 (i1 int) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (i2 int, INDEX(i2)) ENGINE=MyISAM;
CREATE TABLE t3 (i3 int, c varchar(1), INDEX(i3), INDEX(c)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (3,'x'),(4,'y');
SELECT * FROM t1 WHERE ( 1, 1 ) IN (
SELECT i2, i2 FROM t2 LEFT OUTER JOIN (
t3 AS t3a INNER JOIN t3 AS t3b ON ( t3a.i3 = t3b.i3 )
) ON ( t3a.c = t3b.c )
);
i1
DROP TABLE t1,t2,t3;
DROP TABLE IF EXISTS t1,t2,t3,t4;
#
# MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin
......
......@@ -1109,6 +1109,21 @@ COUNT(*)
3724
set optimizer_prune_level=@tmp_951283;
DROP TABLE t1,t2;
#
# Bug mdev-5135: crash on semijoin with nested outer joins
#
CREATE TABLE t1 (i1 int) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (i2 int, INDEX(i2)) ENGINE=MyISAM;
CREATE TABLE t3 (i3 int, c varchar(1), INDEX(i3), INDEX(c)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (3,'x'),(4,'y');
SELECT * FROM t1 WHERE ( 1, 1 ) IN (
SELECT i2, i2 FROM t2 LEFT OUTER JOIN (
t3 AS t3a INNER JOIN t3 AS t3b ON ( t3a.i3 = t3b.i3 )
) ON ( t3a.c = t3b.c )
);
i1
DROP TABLE t1,t2,t3;
DROP TABLE IF EXISTS t1,t2,t3,t4;
#
# MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin
......
......@@ -1096,6 +1096,21 @@ COUNT(*)
3724
set optimizer_prune_level=@tmp_951283;
DROP TABLE t1,t2;
#
# Bug mdev-5135: crash on semijoin with nested outer joins
#
CREATE TABLE t1 (i1 int) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (i2 int, INDEX(i2)) ENGINE=MyISAM;
CREATE TABLE t3 (i3 int, c varchar(1), INDEX(i3), INDEX(c)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (3,'x'),(4,'y');
SELECT * FROM t1 WHERE ( 1, 1 ) IN (
SELECT i2, i2 FROM t2 LEFT OUTER JOIN (
t3 AS t3a INNER JOIN t3 AS t3b ON ( t3a.i3 = t3b.i3 )
) ON ( t3a.c = t3b.c )
);
i1
DROP TABLE t1,t2,t3;
DROP TABLE IF EXISTS t1,t2,t3,t4;
#
# MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin
......
......@@ -80,8 +80,10 @@ SET SESSION innodb_strict_mode = ON;
DROP TABLE IF EXISTS t1;
--echo # 'FIXED' is sent to InnoDB since it is used by MyISAM.
--echo # But it is an invalid mode in InnoDB
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
CREATE TABLE t1 ( i INT ) ROW_FORMAT=FIXED;
--replace_regex / - .*[0-9]*[)]/)/
SHOW WARNINGS;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=0;
SHOW WARNINGS;
......@@ -108,14 +110,20 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE
--echo # Test 2) StrictMode=ON, CREATE with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE
--echo # KEY_BLOCK_SIZE is incompatible with COMPACT, REDUNDANT, & DYNAMIC
DROP TABLE IF EXISTS t1;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1;
--replace_regex / - .*[0-9]*[)]/)/
SHOW WARNINGS;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2;
--replace_regex / - .*[0-9]*[)]/)/
SHOW WARNINGS;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4;
--replace_regex / - .*[0-9]*[)]/)/
SHOW WARNINGS;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
SHOW WARNINGS;
......@@ -214,8 +222,10 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE
--echo # Test 6) StrictMode=ON, CREATE with an invalid KEY_BLOCK_SIZE.
DROP TABLE IF EXISTS t1;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=9;
--replace_regex / - .*[0-9]*[)]/)/
SHOW WARNINGS;
--echo # Test 7) StrictMode=ON, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and
......@@ -223,14 +233,20 @@ SHOW WARNINGS;
--echo # and that they can be set to default values during strict mode.
SET GLOBAL innodb_file_format=Antelope;
DROP TABLE IF EXISTS t1;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=4;
--replace_regex / - .*[0-9]*[)]/)/
SHOW WARNINGS;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED;
--replace_regex / - .*[0-9]*[)]/)/
SHOW WARNINGS;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
--replace_regex / - .*[0-9]*[)]/)/
SHOW WARNINGS;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT;
SHOW WARNINGS;
......@@ -270,14 +286,20 @@ SET GLOBAL innodb_file_format=Barracuda;
--echo # values during strict mode.
SET GLOBAL innodb_file_per_table=OFF;
DROP TABLE IF EXISTS t1;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=1;
--replace_regex / - .*[0-9]*[)]/)/
SHOW WARNINGS;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED;
--replace_regex / - .*[0-9]*[)]/)/
SHOW WARNINGS;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC;
--replace_regex / - .*[0-9]*[)]/)/
SHOW WARNINGS;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT;
SHOW WARNINGS;
......
......@@ -175,8 +175,10 @@ set innodb_strict_mode = on;
create table t1 (id int primary key) engine = innodb key_block_size = 0;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
create table t2 (id int primary key) engine = innodb key_block_size = 9;
--replace_regex / - .*[0-9]*[)]/)/
show warnings;
......@@ -202,19 +204,25 @@ drop table t1, t3, t4, t5, t8, t9, t10, t11;
create table t1 (id int primary key) engine = innodb
key_block_size = 4 row_format = compressed;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
create table t2 (id int primary key) engine = innodb
key_block_size = 4 row_format = redundant;
--replace_regex / - .*[0-9]*[)]/)/
show warnings;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
create table t3 (id int primary key) engine = innodb
key_block_size = 4 row_format = compact;
--replace_regex / - .*[0-9]*[)]/)/
show warnings;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
create table t4 (id int primary key) engine = innodb
key_block_size = 4 row_format = dynamic;
--replace_regex / - .*[0-9]*[)]/)/
show warnings;
create table t5 (id int primary key) engine = innodb
......@@ -224,19 +232,25 @@ key_block_size = 4 row_format = default;
drop table t1, t5;
#test multiple errors
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
create table t1 (id int primary key) engine = innodb
key_block_size = 9 row_format = redundant;
--replace_regex / - .*[0-9]*[)]/)/
show warnings;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
create table t2 (id int primary key) engine = innodb
key_block_size = 9 row_format = compact;
--replace_regex / - .*[0-9]*[)]/)/
show warnings;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
create table t2 (id int primary key) engine = innodb
key_block_size = 9 row_format = dynamic;
--replace_regex / - .*[0-9]*[)]/)/
show warnings;
--eval $query_i_s
......@@ -244,12 +258,17 @@ show warnings;
#test valid values with innodb_file_per_table unset
set global innodb_file_per_table = off;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
create table t1 (id int primary key) engine = innodb key_block_size = 1;
--replace_regex / - .*[0-9]*[)]/)/
show warnings;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
create table t2 (id int primary key) engine = innodb key_block_size = 2;
--replace_regex / - .*[0-9]*[)]/)/
show warnings;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
create table t3 (id int primary key) engine = innodb key_block_size = 4;
show warnings;
......@@ -259,9 +278,12 @@ show warnings;
--error ER_CANT_CREATE_TABLE
create table t6 (id int primary key) engine = innodb row_format = compressed;
--replace_regex / - .*[0-9]*[)]/)/
show warnings;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
create table t7 (id int primary key) engine = innodb row_format = dynamic;
--replace_regex / - .*[0-9]*[)]/)/
show warnings;
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
......@@ -274,12 +296,17 @@ drop table t8, t9;
set global innodb_file_per_table = on;
set global innodb_file_format = `0`;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
create table t1 (id int primary key) engine = innodb key_block_size = 1;
--replace_regex / - .*[0-9]*[)]/)/
show warnings;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
create table t2 (id int primary key) engine = innodb key_block_size = 2;
--replace_regex / - .*[0-9]*[)]/)/
show warnings;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
create table t3 (id int primary key) engine = innodb key_block_size = 4;
show warnings;
......@@ -289,9 +316,12 @@ show warnings;
--error ER_CANT_CREATE_TABLE
create table t6 (id int primary key) engine = innodb row_format = compressed;
--replace_regex / - .*[0-9]*[)]/)/
show warnings;
--replace_regex / - .*[0-9]*[)]/)/
--error ER_CANT_CREATE_TABLE
create table t7 (id int primary key) engine = innodb row_format = dynamic;
--replace_regex / - .*[0-9]*[)]/)/
show warnings;
create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant;
......
......@@ -8,7 +8,7 @@
# TODO: fix with a proper comparison in mysqltest
let $rcd= `SELECT REPLACE('$MYSQL_CHARSETSDIR', '\\\\\', '.')`;
let $rcd= `SELECT REPLACE('$rcd', '/', '.')`;
let $regex_charsetdir= `SELECT '/$rcd[\\\\\/\\\\\]/MYSQL_CHARSETSDIR/'`;
let $regex_charsetdir= `SELECT '/$rcd[[:punct:]]/MYSQL_CHARSETSDIR/'`;
--replace_regex $regex_charsetdir
select @@global.character_sets_dir;
......
......@@ -10,14 +10,23 @@ sub list_cases {
sub start_test {
my ($self, $tinfo)= @_;
my $args=[ ];
my $args;
my $path;
my $cmd = $self->{ctests}->{$tinfo->{shortname}};
if ($cmd =~ /[ "'><%!*?]/) {
($path, $args) = ('/bin/sh', [ '-c', $cmd ])
} else {
($path, $args) = ($cmd, , [ ])
}
my $oldpwd=getcwd();
chdir $::opt_vardir;
my $proc=My::SafeProcess->new
(
name => $tinfo->{shortname},
path => $self->{ctests}->{$tinfo->{shortname}},
path => $path,
args => \$args,
append => 1,
output => $::path_current_testlog,
......
......@@ -209,15 +209,15 @@ set names utf8;
set names utf8;
# This should return TRUE
select 'вася' rlike '[[:<:]]вася[[:>:]]';
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
select ' вася' rlike '[[:<:]]вася[[:>:]]';
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
select 'вася' rlike '\\bвася\\b';
select 'вася ' rlike '\\bвася\\b';
select ' вася' rlike '\\bвася\\b';
select ' вася ' rlike '\\bвася\\b';
# This should return FALSE
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
select 'васяz' rlike '\\bвася\\b';
select 'zвася' rlike '\\bвася\\b';
select 'zвасяz' rlike '\\bвася\\b';
#
# Bug #4555
......
......@@ -207,15 +207,15 @@ set names utf8mb4;
set names utf8mb4;
# This should return TRUE
select 'вася' rlike '[[:<:]]вася[[:>:]]';
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
select ' вася' rlike '[[:<:]]вася[[:>:]]';
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
select 'вася' rlike '\\bвася\\b';
select 'вася ' rlike '\\bвася\\b';
select ' вася' rlike '\\bвася\\b';
select ' вася ' rlike '\\bвася\\b';
# This should return FALSE
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
select 'васяz' rlike '\\bвася\\b';
select 'zвася' rlike '\\bвася\\b';
select 'zвасяz' rlike '\\bвася\\b';
#
# Bug #4555
......
......@@ -1545,6 +1545,39 @@ DROP TABLE t1,t2;
set optimizer_switch=@save_optimizer_switch;
--echo #
--echo # mdev-5078: sum over a view/derived table
--echo #
CREATE TABLE t1 (a int);
INSERT INTO t1 (a) VALUES (1), (2);
CREATE TABLE t2 (b int(11));
INSERT INTO t2 (b) VALUES (1), (2);
CREATE VIEW v AS SELECT b as c FROM t2;
SELECT a, (SELECT SUM(a + c) FROM v) FROM t1;
SELECT a, (SELECT SUM(a + c) FROM (SELECT b as c FROM t2) AS v1) FROM t1;
DROP VIEW v;
DROP TABLE t1,t2;
--echo #
--echo # mdev-5105: memory overwrite in multi-table update
--echo # using natuaral join with a view
--echo #
create table t1(a int,b tinyint,c tinyint)engine=myisam;
create table t2(a tinyint,b float,c int, d int, e int, f int, key (b), key(c), key(d), key(e), key(f))engine=myisam;
create table t3(a int,b int,c int, d int, e int, f int, key(a), key(b), key(c), key(d), key(e), key(f))engine=myisam;
create view v1 as select t2.b a, t1.b b, t2.c c, t2.d d, t2.e e, t2.f f from t1,t2 where t1.a=t2.a;
update t3 natural join v1 set a:=1;
drop view v1;
drop table t1,t2,t3;
--echo #
--echo # end of 5.3 tests
--echo #
......
......@@ -683,6 +683,64 @@ select distinct (select max(a) from t1 where alias.b = a) as field1 from t2 as a
drop view v;
drop table t1, t2;
#
# Bug mdev-5028: invalid distinct optimization when join buffer is used
#
CREATE TABLE t1 (
id int, i1 int, i2 int DEFAULT 0,
d1 date DEFAULT '2000-01-01', d2 date DEFAULT '2000-01-01',
t1 time DEFAULT '00:00:00', t2 time DEFAULT '00:00:00',
dt1 datetime NOT NULL DEFAULT '2000-01-01 00:00:00',
dt2 datetime NOT NULL DEFAULT '2000-01-01 00:00:00',
c1 varchar(1) NOT NULL, c2 varchar(1) NOT NULL
) ENGINE=MyISAM;
CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 (id,i1,c1,c2) VALUES
(1,7,'t','t'),(2,4,'k','k'),(3,2,'e','e'),(4,0,'i','i'),(5,1,'t','t'),(6,91,'m','m'),
(7,6,'z','z'),(8,3,'c','c'),(9,6,'i','i'),(10,8,'v','v'), (11,1,'l','l'),(12,4,'j','j'),
(13,5,'w','w'),(14,0,'r','r'),(15,7,'o','o'),(16,9,'o','o'),(17,7,'u','u'),(18,6,'f','f'),
(19,0,'l','l'),(20,6,'g','g'),(21,1,'e','e'),(22,7,'y','y'),(23,0,'p','p'),(24,6,'v','v'),
(25,5,'d','d'),(26,9,'i','i'),(27,5,'z','z'),(28,2,'q','q'),(29,4,'j','j'),(30,9,'m','m'),
(31,8,'d','d'),(32,5,'r','r'),(33,1,'r','r'),(34,1,'k','k'),(35,4,'p','p'),(36,2,'x','x'),
(37,5,'w','w'),(38,0,'k','k'),(39,7,'y','y'),(40,4,'p','p'),(41,9,'l','l'),(42,2,'u','u'),
(43,3,'r','r'),(44,5,'y','y'),(45,3,'u','u'),(46,9,'t','t'),(47,8,'f','f'),(48,2,'f','f'),
(49,2,'q','q'),(50,6,'v','v'),(51,6,'u','u'),(52,0,'b','b'),(53,1,'n','n'),(54,2,'p','p'),
(55,0,'y','y'),(56,1,'l','l'),(57,1,'c','c'),(58,0,'d','d'),(59,2,'y','y'),(60,7,'l','l'),
(61,6,'m','m'),(62,9,'q','q'),(63,0,'j','j'),(64,3,'u','u'),(65,4,'w','w'),(66,5,'p','p'),
(67,8,'z','z'),(68,5,'u','u'),(69,7,'b','b'),(70,0,'f','f'),(71,6,'u','u'),(72,1,'i','i'),
(73,9,'s','s'),(74,3,'y','y'),(75,5,'s','s'),(76,8,'x','x'),(77,3,'s','s'),(78,3,'l','l'),
(79,8,'b','b'),(80,0,'p','p'),(81,9,'m','m'),(82,5,'k','k'),(83,7,'u','u'),(84,0,'y','y'),
(85,2,'x','x'),(86,5,'h','h'),(87,5,'j','j'),(88,5,'o','o'),(89,9,'o','o'),(90,1,'c','c'),
(91,7,'k','k'),(92,9,'t','t'),(93,3,'h','h'),(94,6,'g','g'),(95,9,'r','r'),(96,2,'i','i');
CREATE TABLE t2 (i INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (7),(8);
SELECT STRAIGHT_JOIN COUNT(DISTINCT t1.id) FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
EXPLAIN EXTENDED
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
set join_buffer_size=1024;
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
set join_buffer_size=1024*16;
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
set join_buffer_size=default;
SELECT STRAIGHT_JOIN DISTINCT t1.id FROM
t1, v1, t2 WHERE v1.id = t2.i AND t1.i1 = v1.i1 AND t2.i != 3;
DROP VIEW v1;
DROP TABLE t1,t2;
--echo #
--echo # Bug #11744875: 4082: integer lengths cause truncation with distinct concat and innodb
--echo #
......
This diff is collapsed.
......@@ -283,3 +283,15 @@ SELECT * FROM t1 WHERE NOT (concat( dt, '1' ) IS NOT NULL);
SELECT * FROM t1 WHERE NOT (concat( dt, '1' ) IS NOT NULL);
DROP TABLE t1;
--echo #
--echo # Bug mdev-5132: crash when exeicuting a join query
--echo # with IS NULL and IS NOT NULL in where
--echo #
CREATE TABLE t1 (a DATE, b INT, c INT, KEY(a), KEY(b), KEY(c)) ENGINE=MyISAM;
CREATE TABLE t2 (d DATE) ENGINE=MyISAM;
SELECT * FROM t1,t2 WHERE 1 IS NOT NULL AND t1.b IS NULL;
DROP TABLE t1,t2;
......@@ -1225,6 +1225,25 @@ WHERE alias3.d IN (
set optimizer_prune_level=@tmp_951283;
DROP TABLE t1,t2;
--echo #
--echo # Bug mdev-5135: crash on semijoin with nested outer joins
--echo #
CREATE TABLE t1 (i1 int) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (i2 int, INDEX(i2)) ENGINE=MyISAM;
CREATE TABLE t3 (i3 int, c varchar(1), INDEX(i3), INDEX(c)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (3,'x'),(4,'y');
SELECT * FROM t1 WHERE ( 1, 1 ) IN (
SELECT i2, i2 FROM t2 LEFT OUTER JOIN (
t3 AS t3a INNER JOIN t3 AS t3b ON ( t3a.i3 = t3b.i3 )
) ON ( t3a.c = t3b.c )
);
DROP TABLE t1,t2,t3;
--source include/have_innodb.inc
......
THE MAIN PCRE LIBRARY
---------------------
Written by: Philip Hazel
Email local part: ph10
Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England.
Copyright (c) 1997-2013 University of Cambridge
All rights reserved
PCRE JUST-IN-TIME COMPILATION SUPPORT
-------------------------------------
Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
Copyright(c) 2010-2013 Zoltan Herczeg
All rights reserved.
STACK-LESS JUST-IN-TIME COMPILER
--------------------------------
Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
Copyright(c) 2009-2013 Zoltan Herczeg
All rights reserved.
THE C++ WRAPPER LIBRARY
-----------------------
Written by: Google Inc.
Copyright (c) 2007-2012 Google Inc
All rights reserved
####
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
PCRE LICENCE
------------
PCRE is a library of functions to support regular expressions whose syntax
and semantics are as close as possible to those of the Perl 5 language.
Release 8 of PCRE is distributed under the terms of the "BSD" licence, as
specified below. The documentation for PCRE, supplied in the "doc"
directory, is distributed under the same terms as the software itself.
The basic library functions are written in C and are freestanding. Also
included in the distribution is a set of C++ wrapper functions, and a
just-in-time compiler that can be used to optimize pattern matching. These
are both optional features that can be omitted when the library is built.
THE BASIC LIBRARY FUNCTIONS
---------------------------
Written by: Philip Hazel
Email local part: ph10
Email domain: cam.ac.uk
University of Cambridge Computing Service,
Cambridge, England.
Copyright (c) 1997-2013 University of Cambridge
All rights reserved.
PCRE JUST-IN-TIME COMPILATION SUPPORT
-------------------------------------
Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
Copyright(c) 2010-2013 Zoltan Herczeg
All rights reserved.
STACK-LESS JUST-IN-TIME COMPILER
--------------------------------
Written by: Zoltan Herczeg
Email local part: hzmester
Emain domain: freemail.hu
Copyright(c) 2009-2013 Zoltan Herczeg
All rights reserved.
THE C++ WRAPPER FUNCTIONS
-------------------------
Contributed by: Google Inc.
Copyright (c) 2007-2012, Google Inc.
All rights reserved.
THE "BSD" LICENCE
-----------------
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the University of Cambridge nor the name of Google
Inc. nor the names of their contributors may be used to endorse or
promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
End
This diff is collapsed.
This diff is collapsed.
Compiling PCRE on non-Unix systems
----------------------------------
This has been renamed to better reflect its contents. Please see the file
NON-AUTOTOOLS-BUILD for details of how to build PCRE without using autotools.
####
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Modified from FindReadline.cmake (PH Feb 2012)
if(EDITLINE_INCLUDE_DIR AND EDITLINE_LIBRARY AND NCURSES_LIBRARY)
set(EDITLINE_FOUND TRUE)
else(EDITLINE_INCLUDE_DIR AND EDITLINE_LIBRARY AND NCURSES_LIBRARY)
FIND_PATH(EDITLINE_INCLUDE_DIR readline.h
/usr/include/editline
/usr/include/edit/readline
/usr/include/readline
)
FIND_LIBRARY(EDITLINE_LIBRARY NAMES edit)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Editline DEFAULT_MSG EDITLINE_INCLUDE_DIR EDITLINE_LIBRARY )
MARK_AS_ADVANCED(EDITLINE_INCLUDE_DIR EDITLINE_LIBRARY)
endif(EDITLINE_INCLUDE_DIR AND EDITLINE_LIBRARY AND NCURSES_LIBRARY)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment