Merge next-mr -> next-4284.

This commit is contained in:
Konstantin Osipov 2009-12-16 11:33:54 +03:00
commit 980e8b413e
115 changed files with 82821 additions and 150051 deletions

View File

@ -1,4 +1,4 @@
[MYSQL]
post_commit_to = "commits@lists.mysql.com"
post_push_to = "commits@lists.mysql.com"
tree_name = "mysql-5.6-next-mr-bugfixing"
tree_name = "mysql-5.6-next-mr"

View File

@ -1,37 +0,0 @@
.snprj
COPYING
COPYING.LIB
INSTALL-SOURCE
INSTALL-SOURCE-GENERIC
Logs
MIRRORS
Makefile
Makefile.in
NEW-RPMS
PUBLIC
Projects
TODO
WIN-LICENSE
aclocal.m4
binary
compile
confdefs.h
config.cache
config.h
config.log
config.status
configure
configure.in-removed
conftest.c
conftest.s1
conftest.s2
conftest.subs
internal-docs
libtool
linked_client_sources
linked_server_sources
mysql-copyright-120700-194832
mysql-copyright-120700-221248
skr
stamp-h
tmp

View File

@ -1,62 +0,0 @@
44d03f27qNdqJmARzBoP3Is_cN5e0w
44ec850ac2k4y2Omgr92GiWPBAVKGQ
44edb86b1iE5knJ97MbliK_3lCiAXA
44f33f3aj5KW5qweQeekY1LU0E9ZCg
45001f7c3b2hhCXDKfUvzkX9TNe6VA
45002051rHJfMEXAIMiAZV0clxvKSA
4513d8e4Af4dQWuk13sArwofRgFDQw
45143312u0Tz4r0wPXCbUKwdHa2jWA
45143b90ewOQuTW8-jrB3ZSAQvMRJw
45184588w9U72A6KX1hUFeAC4shSHA
45185df8mZbxfp85FbA0VxUXkmDewA
4519a6c5BVUxEHTf5iJnjZkixMBs8g
451ab499rgdjXyOnUDqHu-wBDoS-OQ
451b110a3ZV6MITl93ehXk2wxrbW7g
45214442pBGT9KuZEGixBH71jTzbOA
45214a07hVsIGwvwa-WrO-jpeaSwVw
452a92d0-31-8wSzSfZi165fcGcXPA
452c6c6dAjuNghfc1ObZ_UQ5SCl85g
4538a7b0EbDHHkWPbIwxO6ZIDdg6Dg
454a7ef8gdvE_ddMlJyghvOAkKPNOQ
454bb488ijVLOUK_GFjcoISE0GxPUA
454bb9a8AwlGRC_wWLS2sNMoRBMRGw
454c946ciQoR4dfTBZ0RTBmGJKp6lw
454f6e7eAnfLD9OCbGr5X9KiKvfKcQ
454f704bJiJy0_Nx2drY9P5kK3uOzg
454f8960jsVT_kMKJtZ9OCgXoba0xQ
454fa71cxshxszXJQYa9jbo0-_hAHw
4550b0ceIcozdgQhWFUTAtWkN196lA
4554a95d7txO1DuO9G3nAizI3SkFAA
4554b3722d71SbPiI2Gx-RhbZjmuIQ
4558b3d73Cxjlb7Wv1oytdSTthxDfw
4561b2ecZbhuAc0TTDdCdultxUYaMw
4561bde4qWhz1I8tkItXKex5uniipA
4562ba016dYH0JzszOqZ8p6psbKfnQ
45771031yRCoM_ZfONdYchPvVEgLRg
459a60d8rIxeTuhB3j_QsOwLGdcpng
459a61c9OS8PzIsdviZJDkybJ1y1uA
459a70691aYIfU2ohV0a3P5iTLpO2A
459a7422KF_P7PuU3YQ5qG6ZLEVpiA
459a74e4nRcXppMSBYeQQ5efDkTADg
459c03b9N_mqF2XJKK6DwSrIt7e6_g
459c1965_BQMBzBO8S_gVqjTHYQrmw
459c2098XoAUsUn8N07IVRDD6CTM-A
459ea845XenN-uWqEM5LFvUT60tW_A
45ae6628gqKTsUFfnoNExadETVIkbA
45af88c9RIIJWPfBxs3o7zekI-ELPQ
45ba4faf2oqu6eR8fqecR3LfSNcYUg
45ba5238-NKl80QVXzdGo8hO9M75Xg
45c0fdfb2mz6NdOIsLenJtf6_ZelTA
45c38d90tNwOTSaYKHXd3ccLtnytlQ
45c390d6BbWrwyEi5T5VsWKYxl06Rg
45c39d31g0iik6UE_oTK5N55ry-ycA
45d1ffcd-r3v8A7uh92hQaMfQM9UPQ
45d21437Vg_-i4uOWyvzYWHESXDP6A
45da6370nnZlAAIieMCrXkxF9toOyQ
45da6551zUuplwxuqcT2fhRgceC0CQ
45db0d4bkGtxBk21sZFJgbCV1FcNRg
45db468b-DKE8kUTV42eYMYmk8_g9g
45dd21d1rVPnDfvZTNVHLalcjnbsZw
45ddaf15_Ld7IAEpUUP3FJjJ-oSEFg
45ddc763DodLG1BqH_wRBJXMbCSB5A
45ddc8282KnaNGuijqCTphlXV_eeog

View File

@ -1,80 +0,0 @@
# This is the BitKeeper configuration for this package.
#
# Please take a minute to fill it out carefully, it needs to be accurate.
#
# NOTICE: you really do want to fill this out, if something goes wrong
# with your repository, or if someone changes the logging policy, we
# send mail to the contact listed here for confirmation.
#
# BitKeeper can maintain a log of your change comments (not your source,
# just the comments) on a centralized server. This is useful as your
# project grows, it gives people a place to go see what is happening on
# a per project basis. This is especially useful for distributed developers.
#
#
# Name of the project, such as "BitKeeper" or "The GNU C compiler".
#
description: MySQL - fast and reliable SQL database
#
# Open Logging server. This site is where users go to see the
# changelog comments for all instances of this repository. This must
# be logging@openlogging.org for usage under the terms of the BKL,
# "bk help bkl" will show you the default licensing terms. If this
# repository is commercial it can be an internal email address or "none"
# to disable logging.
#
logging: none
#
# If this field is set, all checkins will appear to be made by this user,
# in effect making this a single user package. Single user packages are
# free from the logging constraint. In order for the package to really
# be free, both the single_user and the single_host field need to be set.
#
single_user:
#
# If this field is set, all checkins will appear to be made on this host.
#
single_host:
#
# Contact person for this project. This is whoever is the person that
# should be contacted with update information or contacted if BitKeeper
# discovers a problem which requires local intervention. Please make the
# contact information accurate so we can support you.
#
contact: sys@mysql.com
#
# It is very important that this email address is filled out and accurate.
# If someone converts your repository to open logging (which you may not
# want), we will contact this email address for confirmation that you really
# did want open logging. If the email address is inaccurate and we get no
# response from anyone else at your location after 90 days, then open logging
# will be implicitly approved.
#
email: sys@mysql.com
#
# Add your street address if you like, it is optional.
#
street:
city:
state:
postal:
country:
phone:
cell:
pager:
#
# Business Hours when we can contact you if you left a phone number.
#
hours:
[serg:]checkout:get
[arjen:]checkout:get
[kostja:]checkout:get
[nick:]checkout:get
[jonas:]checkout:get
[tomas:]checkout:get
[guilhem:]checkout:get
[pekka:]checkout:get
[msvensson:]checkout:get
checkout:edit
eoln:unix

File diff suppressed because it is too large Load Diff

View File

@ -1,314 +0,0 @@
Administrador@light.
Administrator@co3064164-a.
Administrator@co3064164-a.rochd1.qld.optushome.com.au
Administrator@fred.
Administrator@w2k.
Greg@greg-laptop.
Miguel@light.local
Sinisa@sinisa.nasamreza.org
WAX@sergbook.mysql.com
acurtis@ltantony.rdg.cyberkinetica.homeunix.net
acurtis@pcgem.rdg.cyberkinetica.com
acurtis@xiphis.org
administrador@light.hegel.local
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
akishkin@work.mysql.com
anjuta@arthur.local
antony@ltantony.dsl-verizon.net
antony@ltantony.mysql.com
antony@ltantony.rdg.cyberkinetica.com
antony@ltantony.rdg.cyberkinetica.homeunix.net
antony@ltantony.xiphis.org
arjen@bitbike.com
arjen@co3064164-a.bitbike.com
arjen@fred.bitbike.com
arjen@george.bitbike.com
autotest@mc01.ndb.mysql.com
bar@bar.intranet.mysql.r18.ru
bar@bar.mysql.r18.ru
bar@bar.udmsearch.izhnet.ru
bar@deer.(none)
bar@eagle.intranet.mysql.r18.ru
bar@gw.udmsearch.izhnet.ru
bar@mysql.com
bar@noter.intranet.mysql.r18.ru
bell@51.0.168.192.in-addr.arpa
bell@52.0.168.192.in-addr.arpa
bell@book.sanja.is.com.ua
bell@laptop.sanja.is.com.ua
bell@sanja.is.com.ua
bk@admin.bk
bk@mysql.r18.ru
brian@avenger.(none)
brian@brian-akers-computer.local
brian@private-client-ip-101.oz.net
brian@zim.(none)
carsten@tsort.bitbybit.dk
cps@silver_beast.(none)
davida@isil.mysql.com
dean@mysql.com
dellis@goetia.(none)
dlenev@brandersnatch.localdomain
dlenev@build.mysql.com
dlenev@jabberwock.localdomain
dlenev@mysql.com
ejonore@mc03.ndb.mysql.com
elliot@mysql.com
evgen@moonbone.(none)
evgen@moonbone.local
gbichot@bk-internal.mysql.com
gbichot@production.mysql.com
gbichot@quadita2.mysql.com
gbichot@quadxeon.mysql.com
geert@kriem.kemuri.org
georg@beethoven.local
georg@beethoven.site
georg@lmy002.wdf.sap.corp
gerberb@ou800.zenez.com
gluh@eagle.intranet.mysql.r18.ru
gluh@gluh.(none)
gluh@gluh.mysql.r18.ru
gluh@mysql.com
gordon@zero.local.lan
greg@gcw.ath.cx
greg@mysql.com
guilhem@mysql.com
gweir@build.mysql.com
gweir@work.mysql.com
harrison@mysql.com
harry@corona.lordblink.com
hartmut@mysql.com
heikki@donna.mysql.fi
heikki@hundin.mysql.fi
heikki@rescue.
heikki@work.mysql.com
hf@bison.(none)
hf@bisonxp.(none)
hf@deer.(none)
hf@deer.mysql.r18.ru
hf@genie.(none)
holyfoot@mysql.com
igor@hundin.mysql.fi
igor@igor-inspiron.creware.com
igor@linux.local
igor@rurik.mysql.com
ingo@mysql.com
jan@hundin.mysql.fi
jani@a193-229-222-105.elisa-laajakaista.fi
jani@a193-229-222-2.elisa-laajakaista.fi
jani@a80-186-24-72.elisa-laajakaista.fi
jani@a80-186-41-201.elisa-laajakaista.fi
jani@a80-186-8-224.elisa-laajakaista.fi
jani@dsl-jkl1657.dial.inet.fi
jani@dsl-kpogw4gb5.dial.inet.fi
jani@hynda.(none)
jani@hynda.mysql.fi
jani@ibmlab.site
jani@janikt.pp.saunalahti.fi
jani@linux.local
jani@rhols221.adsl.netsonic.fi
jani@rhols221.arenanet.fi
jani@ua126d19.elisa.omakaista.fi
jani@ua141d10.elisa.omakaista.fi
jani@ua167d18.elisa.omakaista.fi
jani@ua72d24.elisa.omakaista.fi
jcole@abel.spaceapes.com
jcole@main.burghcom.com
jcole@mugatu.jcole.us
jcole@mugatu.spaceapes.com
jcole@sarvik.tfr.cafe.ee
jcole@tetra.spaceapes.com
jimw@mysql.com
joerg@mysql.com
joerg@trift-lap.fambruehe
jon@gigan.
jonas@mysql.com
joreland@bk-internal.mysql.com
joreland@mysql.com
jorge@linux.jorge.mysql.com
jplindst@t41.(none)
kaa@polly.local
kaj@work.mysql.com
kent@mysql.com
konstantin@mysql.com
kosipov@production.mysql.com
kostja@oak.local
lars@mysql.com
lenz@kallisto.mysql.com
lenz@mysql.com
magnus@msdesk.mysql.com
magnus@neptunus.(none)
magnus@shellback.(none)
marko@hundin.mysql.fi
marty@flipper.bredbandsbolaget.se
marty@linux.site
marty@shark.
mats@mysql.com
matt@booty.(none)
matt@mysql.com
matthias@three.local.lan
miguel@hegel.(none)
miguel@hegel.br
miguel@hegel.local
miguel@hegel.txg
miguel@hegel.txg.br
miguel@light.
miguel@light.local
miguel@sartre.local
mikael@mc04.(none)
mikael@orca.ndb.mysql.com
mikron@c-fb0ae253.1238-1-64736c10.cust.bredbandsbolaget.se
mikron@mikael-ronstr-ms-dator.local
mleich@mysql.com
mmatthew@markslaptop.
monty@bitch.mysql.fi
monty@butch.
monty@donna.mysql.fi
monty@hundin.mysql.fi
monty@mashka.(none)
monty@mashka.mysql.fi
monty@mishka.local
monty@mishka.mysql.fi
monty@mysql.com
monty@narttu.
monty@narttu.mysql.fi
monty@rescue.
monty@tik.
monty@tik.mysql.fi
monty@tramp.mysql.fi
monty@work.mysql.com
mronstrom@build.mysql.com
mronstrom@mysql.com
mskold@bk-internal.mysql.com
mskold@mysql.com
msvensson@build.mysql.com
msvensson@neptunus.(none)
msvensson@neptunus.homeip.net
mwagner@cash.mwagner.org
mwagner@evoq.mwagner.org
mwagner@here.mwagner.org
mwagner@mysql.com
mwagner@ultrafly.mysql.com
mwagner@work.mysql.com
mydev@mysql.com
mysql@home.(none)
mysql@mc04.(none)
mysqldev@bk-internal.mysql.com
mysqldev@build.mysql2.com
mysqldev@melody.local
mysqldev@mysql.com
mysqldev@o2k.irixworld.net
ndbdev@dl145b.mysql.com
ndbdev@dl145c.mysql.com
ndbdev@eel.hemma.oreland.se
ndbdev@ndbmaster.mysql.com
ndbdev@shark.
nick@mysql.com
nick@nick.leippe.com
obarnir@mysql.com
papa@gbichot.local
patg@krsna.
patg@krsna.patg.net
patg@patrick-galbraiths-computer.local
patg@patrick.local
patg@pc248.lfp.kcls.org
patg@radha.local
paul@central.snake.net
paul@frost.snake.net
paul@ice.local
paul@ice.snake.net
paul@kite-hub.kitebird.com
paul@snake-hub.snake.net
paul@teton.kitebird.com
pekka@mysql.com
pem@mysql.com
pem@per-erik-martins-dator.local
peter@linux.local
peter@mysql.com
peterg@mysql.com
petr@mysql.com
pgulutzan@linux.local
pmartin@build.mysql2.com
psergey@psergey-rh8.(none)
psergey@psergey.(none)
ram@deer.(none)
ram@gw.mysql.r18.ru
ram@gw.udmsearch.izhnet.ru
ram@mysql.r18.ru
ram@ram-book.(none)
ram@ram.(none)
ramil@mysql.com
ranger@regul.home.lan
rburnett@bk-internal.mysql.com
rburnett@build.mysql.com
reggie@bob.(none)
reggie@mdk10.(none)
reggie@monster.
root@home.(none)
root@mc04.(none)
root@x3.internalnet
salle@banica.(none)
salle@geopard.(none)
salle@geopard.online.bg
salle@vafla.home
salle@vafla.online.bg
sasha@mysql.sashanet.com
schwenke@lmy003.wdf.sap.corp
schwenke@lmy003.xl.local
serg@build.mysql.com
serg@build.mysql2.com
serg@mysql.com
serg@serg.mylan
serg@serg.mysql.com
serg@sergbook.mylan
serg@sergbook.mysql.com
sergefp@mysql.com
shuichi@mysql.com
sinisa@rhols221.adsl.netsonic.fi
stewart@mysql.com
svoj@mysql.com
tfr@beta.frontier86.ee
tfr@indrek.tfr.cafe.ee
tfr@sarvik.tfr.cafe.ee
tim@bitch.mysql.fi
tim@black.box
tim@hundin.mysql.fi
tim@sand.box
tim@siva.hindu.god
tim@threads.polyesthetic.msg
tim@white.box
tim@work.mysql.com
timour@mysql.com
tom@basil-firewall.home.com
tomas@mc05.(none)
tomas@poseidon.(none)
tomas@poseidon.bredbandsbolaget.se
tomas@poseidon.elisa-laajakaista.fi
tomas@poseidon.ndb.mysql.com
tonu@hundin.mysql.fi
tonu@volk.internalnet
tonu@x153.internalnet
tonu@x3.internalnet
tsmith@build.mysql.com
tulin@build.mysql.com
tulin@dl145b.mysql.com
tulin@dl145c.mysql.com
tulin@mysql.com
ulli@morbus.(none)
venu@hundin.mysql.fi
venu@myvenu.com
venu@work.mysql.com
vtkachenko@intelp4d.mysql.com
vtkachenko@mail.mysql.com
vva@eagle.mysql.r18.ru
vva@genie.(none)
vva@mysql.r18.ru
walrus@kishkin.ru
walrus@mysql.com
wax@kishkin.ru
wax@mysql.com
worm@altair.is.lan
zak@balfor.local
zak@linux.local
zak@mysql.com
zgreant@mysql.com

View File

@ -1 +0,0 @@
dev@mysql.com

View File

@ -1,7 +0,0 @@
BK|scripts/safe_mysqld.sh|19700101030959|01930|d0a3cc73fd1b0d8d tim@localhost.polyesthetic.msg|scripts/safe_mysqld.sh|20000802235627|38519
bk@work.mysql.com|BitKeeper/etc/logging_ok|20000731192914|03271|5e19f6258f804ffe arjen@co3064164-a.bitbike.com|BitKeeper/etc/logging_ok|20011212060636|33009
bk@work.mysql.com|BitKeeper/etc/logging_ok|20000731192914|03271|5e19f6258f804ffe jcole@tetra.bedford.progress.com|BitKeeper/etc/logging_ok|20001004201211|30554
bk@work.mysql.com|BitKeeper/etc/logging_ok|20000731192914|03271|5e19f6258f804ffe sasha@work.mysql.com|BitKeeper/etc/logging_ok|20000802223223|24242
bk@work.mysql.com|BitKeeper/etc/logging_ok|20000731192914|03271|5e19f6258f804ffe tim@localhost.polyesthetic.msg|BitKeeper/etc/logging_ok|20000802235640|27343
bk@work.mysql.com|ChangeSet|20000731191004|44203|eae70093a6122e66+ sasha@work.mysql.com|ChangeSet|20000802223249|54774
bk@work.mysql.com|ChangeSet|20000731191004|44203|eae70093a6122e66+ tim@localhost.polyesthetic.msg|ChangeSet|20000802235645|56533

View File

@ -1,14 +0,0 @@
#!/bin/sh
shift
REPO=`bk gethost`:`pwd`
TO=dev@mysql.com
if [ -f BitKeeper/etc/pushed -a "$BK_OUTGOING" = OK ]
then (
echo ${USER}@"$@"
echo ""
bk changes - < BitKeeper/etc/pushed
) | mail -s "Outgoing from $REPO" $TO
else
echo ${USER}@"$@"| mail -s "Outgoing from $REPO = $BK_OUTGOING" $TO
fi

View File

@ -1,134 +0,0 @@
#!/bin/sh
#shift
if [ -n "$BK_USER" ]
then
COMMITTER=$BK_USER
else
COMMITTER=$USER
fi
FROM=$COMMITTER@mysql.com
COMMITS=commits@lists.mysql.com
DOCS=docs-commit@mysql.com
LIMIT=10000
VERSION="5.1"
BKROOT=`bk root`
if [ -x /usr/sbin/sendmail ]; then
SENDMAIL=/usr/sbin/sendmail
else
SENDMAIL=sendmail
fi
if [ "$REAL_EMAIL" = "" ]
then
echo "Warning: you must set REAL_EMAIL in your profile"
else
FROM=$REAL_EMAIL
fi
BK_STATUS=$BK_STATUS$BK_COMMIT
if [ "$BK_STATUS" = OK ]
then
HAS_ACTUAL_CHANGES=`bk cset -r+ -d | grep -v "^#"`
if [ "$HAS_ACTUAL_CHANGES" = "" ]
then
echo ChangeSet had no real changes, not sending emails
exit
fi
IS_MERGE=`bk changes -r+ -k -m`
if [ "$IS_MERGE" = "" ]
then
echo Merge changeset, not sending mails
exit
fi
CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet`
CSETKEY=`bk -R prs -r+ -h -d':KEY:' ChangeSet`
#
# composing subject lines of commit mails.
# if a fix targets to a WL and there is a bug referred
# then X-Bug mail header will contain the first found bug's number
#
BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | \
sed -ne 's/[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/BUG#\1/
s/.*BUG#\([0-9][0-9]*\)/\1/p'`
WL=`bk -R prs -r+ -h -d':C:' ChangeSet | \
sed -ne 's/[Ww][Ll] *# *\([0-9][0-9]*\).*$/WL#\1/
s/.*\(WL#[0-9][0-9]*\)/ \1/p'`
if [ "$BUG" = "" ]
then
# TO=dev-public@mysql.com
BS=""
BH=""
else
# TO=dev-bugs@mysql.com
BS=" BUG#$BUG"
# need newline here
BH="X-Bug: $BUG
"
fi
#++
# commits@ or dev-private@ mail
#--
LIST="commits"
TO="commits@lists.mysql.com"
if [ -f .tree-is-private ]
then
LIST="dev-private"
TO="dev-private@mysql.com"
fi
echo "Notifying $LIST list at $TO"
(
cat <<EOF
List-ID: <bk.mysql-$VERSION>
From: $FROM
To: $TO
Subject: bk commit into $VERSION tree ($CHANGESET)$BS
X-CSetKey: <$CSETKEY>
$BH
Below is the list of changes that have just been committed into a local
$VERSION repository of $COMMITTER. When $COMMITTER does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
EOF
bk changes -v -r+
bk rset -r+ -ah | bk gnupatch -h -dup -T
) | bk sed -e ${LIMIT}q > $BKROOT/BitKeeper/tmp/commits.txt
$SENDMAIL -t < $BKROOT/BitKeeper/tmp/commits.txt
#++
# docs-commit@ mail
# Picks up anything under the Docs subdirectory (relevant for docs team).
#--
bk changes -v -r+ | grep -q " Docs/"
if [ $? -eq 0 ]
then
echo "Notifying docs list at $DOCS"
(
cat <<EOF
List-ID: <bk.mysql-$VERSION>
From: $FROM
To: $DOCS
Subject: bk commit - $VERSION tree (Manual) ($CHANGESET)$BS
EOF
bk changes -v -r+
bk rset -r+ -ah | bk gnupatch -h -dup -T
) > $BKROOT/BitKeeper/tmp/docs.txt
$SENDMAIL -t < $BKROOT/BitKeeper/tmp/docs.txt
fi
else
echo "commit failed because '$BK_STATUS', you may need to re-clone..."
fi

View File

@ -1,22 +0,0 @@
#! /usr/bin/perl
use strict;
use warnings;
use FindBin;
require "$FindBin::Bin/triggers-lib.pl";
# Don't run unless commit was successful
check_status() || exit 0;
my $cset = latest_cset();
# Read most recent ChangeSet's changed files. Send merge changes along, since
# they'll need to be incorporated in InnoDB's source tree eventually.
my $changes = innodb_get_changes('cset', $cset, 'yes')
or exit 0;
innodb_send_changes_email($cset, $changes)
or exit 1;
exit 0;

View File

@ -1,30 +0,0 @@
#! /usr/bin/perl
use strict;
use warnings;
use FindBin;
require "$FindBin::Bin/triggers-lib.pl";
# Don't run unless push/pull was successful
check_status() or exit 0;
# Don't run if push/pull is in local clones
exit 0 if repository_type() eq 'local';
# For each pushed ChangeSet, check it for InnoDB files and send
# diff of entire ChangeSet to InnoDB developers if such changes
# exist.
my $error = 0;
foreach my $cset (read_bk_csetlist())
{
my $changes = innodb_get_changes('cset', $cset, 'yes')
or next;
innodb_send_changes_email($cset, $changes)
or $error = 1;
}
exit ($error == 0 ? 0 : 1);

View File

@ -1,22 +0,0 @@
#!/bin/sh
if [ "$BK_USER" = "Administrator" -o "$BK_USER" = "mysqldev" ]
then
echo "Error: you cannot commit as 'Administrator' or 'mysqldev' user."
echo "as a workaround set BK_USER to your nickname"
echo "e.g.: export BK_USER='bar'"
echo ""
echo "Checkin FAILED!"
echo "Set BK_USER and retry."
exit 1
fi
if [ "$REAL_EMAIL" = "" ]
then
echo "Error: you must set REAL_EMAIL in your profile"
echo "e.g.: export REAL_EMAIL='Joe Dow <joe@foo.bar>'"
echo ""
echo "Commit FAILED!"
echo "Set REAL_EMAIL and retry."
exit 1
fi

View File

@ -1,26 +0,0 @@
#!/usr/bin/perl
my $status = 0;
my $pending = $ENV{'BK_PENDING'};
exit 0 unless -f $pending;
open FI, "<", $pending || exit 0;
while(<FI>) {
my ($file, $stuff) = split /\|/, $_, 2;
next unless -f $file;
$file =~ s/^(.*)\/([^\/]*)$/$2/;
my $path = $1;
opendir DIR, $path;
my @files = sort map { lc } readdir DIR;
closedir DIR;
my %count = ();
$count{$_}++ for @files;
@files = grep { $count{$_} > 1 } keys %count;
if(@files > 0) {
print "$path/$file: duplicate file names: " . (join " ", @files) . "\n";
$status = 1;
}
}
close FI;
exit $status;

View File

@ -1,21 +0,0 @@
#! /usr/bin/perl
use strict;
use warnings;
use FindBin;
require "$FindBin::Bin/triggers-lib.pl";
die "$0: Script error: \$BK_PENDING is not set in pre-commit trigger\n"
unless defined $ENV{BK_PENDING};
# Read changed files from $BK_PENDING directly. Do not bother user about
# merge changes; they don't have any choice, the merge must be done.
my $changes = innodb_get_changes('file', $ENV{BK_PENDING}, undef)
or exit 0;
innodb_inform_and_query_user($changes)
or exit 1; # Abort commit
# OK, continue with commit
exit 0;

View File

@ -1,22 +0,0 @@
#!/bin/sh
if [ "$BK_USER" = "Administrator" -o "$BK_USER" = "mysqldev" ]
then
echo "Error: you cannot checkin as 'Administrator' or 'mysqldev' user."
echo "as a workaround set BK_USER to your nickname"
echo "e.g.: export BK_USER='bar'"
echo ""
echo "Checkin FAILED!"
echo "Set BK_USER and retry."
exit 1
fi
if [ `tail -c1 $BK_FILE` ]
then
echo "File $BK_FILE does not end with a new-line character!"
echo ""
echo "Checkin FAILED!"
echo "Fix the problem and retry."
exit 1
fi

View File

@ -1,82 +0,0 @@
#! /usr/bin/perl
use strict;
use warnings;
my $event= $ENV{BK_EVENT};
unless($event eq 'outgoing pull' || $event eq 'outgoing push' ||
$event eq 'resolve') {
exit 0;
}
my @bad_csets=
( 'monty@mysql.com|ChangeSet|20060418090255|16983',
'monty@mysql.com|ChangeSet|20060418090458|02628',
'monty@mysql.com|ChangeSet|20060419084236|49576',
'monty@mysql.com|ChangeSet|20060503164655|51444',
'monty@mysql.com|ChangeSet|20060503225814|60133',
'monty@mysql.com|ChangeSet|20060504033006|54878',
'monty@mysql.com|ChangeSet|20060504130520|48660',
'monty@mysql.com|ChangeSet|20060504164102|03511',
'monty@mysql.com|ChangeSet|20060504193112|04109',
'monty@mysql.com|ChangeSet|20060505015314|02799',
'monty@mysql.com|ChangeSet|20060505084007|16704',
'monty@mysql.com|ChangeSet|20060505104008|16695',
'monty@mysql.com|ChangeSet|20060505171041|13924',
'monty@mysql.com|ChangeSet|20060508121933|13866',
'monty@mysql.com|ChangeSet|20060508160902|15029',
'monty@mysql.com|ChangeSet|20060509145448|38636',
'monty@mysql.com|ChangeSet|20060509224111|40037',
'monty@mysql.com|ChangeSet|20060510090758|40678',
'monty@mysql.com|ChangeSet|20060515164104|46760',
'monty@mysql.com|ChangeSet|20060530114549|35852',
'monty@mysql.com|ChangeSet|20060605032828|23579',
'monty@mysql.com|ChangeSet|20060605033011|10641',
'monty@mysql.com|ChangeSet|20060605060652|09843',
'msvensson@neptunus.(none)|ChangeSet|20060605094744|10838',
'msvensson@neptunus.(none)|ChangeSet|20060605105746|11800',
'msvensson@neptunus.(none)|ChangeSet|20060605122345|12772',
'jmiller@mysql.com|ChangeSet|20060531210831|36442',
'jmiller@mysql.com|ChangeSet|20060602151941|36118',
'jmiller@mysql.com|ChangeSet|20060602152136|27762',
'jmiller@mysql.com|ChangeSet|20060605121748|12864',
'jmiller@mysql.com|ChangeSet|20060605160304|14798',
'jimw@mysql.com|ChangeSet|20060605210201|14667',
'igor@rurik.mysql.com|ChangeSet|20060605220727|15265',
'igor@rurik.mysql.com|ChangeSet|20060605221206|15134',
'stewart@mysql.com|ChangeSet|20060525073521|11169',
'stewart@mysql.com|ChangeSet|20060605154220|12975',
'stewart@mysql.com|ChangeSet|20060606040001|15337',
'hartmut@mysql.com/linux.site|ChangeSet|20070413121444|50289'
);
# Read the list of changesets.
my $csetlist = $ENV{BK_CSETLIST};
if(!defined($csetlist) || !open(FH, '<', $csetlist)) {
die "Failed to open list of incoming changesets '$csetlist': $!.\n";
}
my @csets = <FH>;
close FH;
# Reject any attempt to push/pull a bad changeset.
for my $cs (@csets) {
# Do this the raw way, don't want to be bitten by different EOL conventions
# on server and client (Unix/Windows/Mac).
$cs =~ s/\x0d?\x0a?$//s;
if(grep($_ eq $cs, @bad_csets)) {
print <<END;
BAD CHANGESET DETECTED! $event REJECTED!
The changeset with key '$cs' was detected in the attempted push or pull.
This changeset is from the corrupt part of the crashed mysql-5.1-new tree.
Pushing or pulling this changeset would result in corruption of the new tree,
and therefore the operation has been rejected.
Contact Kristian Nielsen (knielsen\@mysql.com, IRC knielsen) if you have any
questions regarding this.
END
exit 1;
}
}
exit 0;

View File

@ -1,82 +0,0 @@
#! /usr/bin/perl
use strict;
use warnings;
my $event= $ENV{BK_EVENT};
unless($event eq 'outgoing pull' || $event eq 'outgoing push' ||
$event eq 'resolve') {
exit 0;
}
my @bad_csets=
( 'monty@mysql.com|ChangeSet|20060418090255|16983',
'monty@mysql.com|ChangeSet|20060418090458|02628',
'monty@mysql.com|ChangeSet|20060419084236|49576',
'monty@mysql.com|ChangeSet|20060503164655|51444',
'monty@mysql.com|ChangeSet|20060503225814|60133',
'monty@mysql.com|ChangeSet|20060504033006|54878',
'monty@mysql.com|ChangeSet|20060504130520|48660',
'monty@mysql.com|ChangeSet|20060504164102|03511',
'monty@mysql.com|ChangeSet|20060504193112|04109',
'monty@mysql.com|ChangeSet|20060505015314|02799',
'monty@mysql.com|ChangeSet|20060505084007|16704',
'monty@mysql.com|ChangeSet|20060505104008|16695',
'monty@mysql.com|ChangeSet|20060505171041|13924',
'monty@mysql.com|ChangeSet|20060508121933|13866',
'monty@mysql.com|ChangeSet|20060508160902|15029',
'monty@mysql.com|ChangeSet|20060509145448|38636',
'monty@mysql.com|ChangeSet|20060509224111|40037',
'monty@mysql.com|ChangeSet|20060510090758|40678',
'monty@mysql.com|ChangeSet|20060515164104|46760',
'monty@mysql.com|ChangeSet|20060530114549|35852',
'monty@mysql.com|ChangeSet|20060605032828|23579',
'monty@mysql.com|ChangeSet|20060605033011|10641',
'monty@mysql.com|ChangeSet|20060605060652|09843',
'msvensson@neptunus.(none)|ChangeSet|20060605094744|10838',
'msvensson@neptunus.(none)|ChangeSet|20060605105746|11800',
'msvensson@neptunus.(none)|ChangeSet|20060605122345|12772',
'jmiller@mysql.com|ChangeSet|20060531210831|36442',
'jmiller@mysql.com|ChangeSet|20060602151941|36118',
'jmiller@mysql.com|ChangeSet|20060602152136|27762',
'jmiller@mysql.com|ChangeSet|20060605121748|12864',
'jmiller@mysql.com|ChangeSet|20060605160304|14798',
'jimw@mysql.com|ChangeSet|20060605210201|14667',
'igor@rurik.mysql.com|ChangeSet|20060605220727|15265',
'igor@rurik.mysql.com|ChangeSet|20060605221206|15134',
'stewart@mysql.com|ChangeSet|20060525073521|11169',
'stewart@mysql.com|ChangeSet|20060605154220|12975',
'stewart@mysql.com|ChangeSet|20060606040001|15337',
'hartmut@mysql.com/linux.site|ChangeSet|20070413121444|50289'
);
# Read the list of changesets.
my $csetlist = $ENV{BK_CSETLIST};
if(!defined($csetlist) || !open(FH, '<', $csetlist)) {
die "Failed to open list of incoming changesets '$csetlist': $!.\n";
}
my @csets = <FH>;
close FH;
# Reject any attempt to push/pull a bad changeset.
for my $cs (@csets) {
# Do this the raw way, don't want to be bitten by different EOL conventions
# on server and client (Unix/Windows/Mac).
$cs =~ s/\x0d?\x0a?$//s;
if(grep($_ eq $cs, @bad_csets)) {
print <<END;
BAD CHANGESET DETECTED! $event REJECTED!
The changeset with key '$cs' was detected in the attempted push or pull.
This changeset is from the corrupt part of the crashed mysql-5.1-new tree.
Pushing or pulling this changeset would result in corruption of the new tree,
and therefore the operation has been rejected.
Contact Kristian Nielsen (knielsen\@mysql.com, IRC knielsen) if you have any
questions regarding this.
END
exit 1;
}
}
exit 0;

View File

@ -1,356 +0,0 @@
# To use this convenience library in a trigger, simply require it at
# at the top of the script. For example:
#
# #! /usr/bin/perl
#
# use FindBin;
# require "$FindBin::Bin/triggers-lib.pl";
#
# FindBin is needed, because sometimes a trigger is called from the
# RESYNC directory, and the trigger dir is ../BitKeeper/triggers
use strict;
use warnings;
use Carp;
use FindBin;
my $mysql_version = "5.1";
# These addresses must be kept current in all MySQL versions.
# See the wiki page InnoDBandOracle.
#my @innodb_to_email = ('dev_innodb_ww@oracle.com');
#my @innodb_cc_email = ('dev-innodb@mysql.com');
# FIXME: Keep this for testing; remove it once it's been used for a
# week or two.
my @innodb_to_email = ('tim@mysql.com');
my @innodb_cc_email = ();
# This is for MySQL >= 5.1. Regex which defines the InnoDB files
# which should generally not be touched by MySQL developers.
my $innodb_files_description = <<EOF;
storage/innobase/*
mysql-test/t/innodb* (except mysql-test/t/innodb_mysql*)
mysql-test/r/innodb* (except mysql-test/r/innodb_mysql*)
EOF
my $innodb_files_regex = qr{
^
(
# Case 1: innobase/*
storage/innobase/
|
# Case 2: mysql-test/[tr]/innodb* (except innodb_mysql*)
mysql-test/(t|r)/SCCS/s.innodb
# The mysql-test/[tr]/innodb_mysql* are OK to edit
(?!_mysql)
)
}x;
# See 'bk help log', and the format of, e.g., $BK_PENDING.
# Important: this already contains the terminating newline!
my $file_rev_dspec = ':SFILE:|:REV:\n';
my $bktmp = "$FindBin::Bin/../tmp";
my $sendmail;
foreach ('/usr/sbin/sendmail', 'sendmail') {
$sendmail = $_;
last if -x $sendmail;
}
my $from = $ENV{REAL_EMAIL} || $ENV{USER} . '@mysql.com';
# close_or_warn
# $fh file handle to be closed
# $description description of the file handle
# RETURN Return value of close($fh)
#
# Print a nice warning message if close() isn't successful. See
# perldoc perlvar and perldoc -f close for details.
sub close_or_warn (*$)
{
my ($fh, $description) = @_;
my $status = close $fh;
if (not $status) {
warn "$0: error on close of '$description': ",
($! ? "$!" : "exit status " . ($? >> 8)), "\n";
}
return $status;
}
# check_status
# $warn If true, warn about bad status
# RETURN TRUE, if $BK_STATUS is "OK"; FALSE otherwise
#
# Also checks the undocumented $BK_COMMIT env variable
sub check_status
{
my ($warn) = @_;
my $status = (grep { defined $_ }
$ENV{BK_STATUS}, $ENV{BK_COMMIT}, '<undef>')[0];
unless ($status eq 'OK')
{
warn "Bad BK_STATUS '$status'\n" if $warn;
return undef;
}
return 1;
}
# repository_location
#
# RETURN ('HOST', 'ROOT') for the repository being modified
sub repository_location
{
if ($ENV{BK_SIDE} eq 'client') {
return ($ENV{BK_HOST}, $ENV{BK_ROOT});
} else {
return ($ENV{BKD_HOST}, $ENV{BKD_ROOT});
}
}
# repository_type
# RETURN:
# 'main' for repo on bk-internal with post-incoming.bugdb trigger
# 'team' for repo on bk-internal with post-incoming.queuepush.pl trigger
# 'local' otherwise
#
# This definition may need to be modified if the host name or triggers change.
sub repository_type
{
my ($host, $root) = repository_location();
return 'local'
unless uc($host) eq 'BK-INTERNAL.MYSQL.COM'
and -e "$root/BitKeeper/triggers/post-incoming.queuepush.pl";
return 'main' if -e "$root/BitKeeper/triggers/post-incoming.bugdb";
return 'team';
}
# latest_cset
# RETURN Key for most recent ChangeSet
sub latest_cset {
chomp(my $retval = `bk changes -r+ -k`);
return $retval;
}
# read_bk_csetlist
# RETURN list of cset keys from $BK_CSETLIST file
sub read_bk_csetlist
{
die "$0: script error: \$BK_CSETLIST not set\n"
unless defined $ENV{BK_CSETLIST};
open CSETS, '<', $ENV{BK_CSETLIST}
or die "$0: can't read \$BK_CSETLIST='$ENV{BK_CSETLIST}': $!\n";
chomp(my @csets = <CSETS>);
close_or_warn(CSETS, "\$BK_CSETLIST='$ENV{BK_CSETLIST}'");
return @csets;
}
# innodb_get_changes
# $type 'file' or 'cset'
# $value file name (e.g., $BK_PENDING) or ChangeSet key
# $want_merge_changes flag; if false, merge changes will be ignored
# RETURN A string describing the InnoDB changes, or undef if no changes
#
# The return value does *not* include ChangeSet comments, only per-file
# comments.
sub innodb_get_changes
{
my ($type, $value, $want_merge_changes) = @_;
if ($type eq 'file')
{
open CHANGES, '<', $value
or die "$0: can't read '$value': $!\n";
}
elsif ($type eq 'cset')
{
open CHANGES, '-|', "bk changes -r'$value' -v -d'$file_rev_dspec'"
or die "$0: can't exec 'bk changes': $!\n";
}
else
{
croak "$0: script error: invalid type '$type'";
}
my @changes = grep { /$innodb_files_regex/ } <CHANGES>;
close_or_warn(CHANGES, "($type, '$value')");
return undef unless @changes;
# Set up a pipeline of 'bk log' commands to weed out unwanted deltas. We
# never want deltas which contain no actual changes. We may not want deltas
# which are merges.
my @filters;
# This tests if :LI: (lines inserted) or :LD: (lines deleted) is
# non-zero. That is, did this delta change the file contents?
push @filters,
"bk log -d'"
. "\$if(:LI: -gt 0){$file_rev_dspec}"
. "\$if(:LI: -eq 0){\$if(:LD: -gt 0){$file_rev_dspec}}"
. "' -";
push @filters, "bk log -d'\$unless(:MERGE:){$file_rev_dspec}' -"
unless $want_merge_changes;
my $tmpname = "$bktmp/ibchanges.txt";
my $pipeline = join(' | ', @filters) . " > $tmpname";
open TMP, '|-', $pipeline
or die "$0: can't exec [[$pipeline]]: $!\n";
print TMP @changes;
close_or_warn(TMP, "| $pipeline");
# Use bk log to describe the changes
open LOG, "bk log - < $tmpname |"
or die "$0: can't exec 'bk log - < $tmpname': $!\n";
my @log = <LOG>;
close_or_warn(LOG, "bk log - < $tmpname |");
unlink $tmpname;
return undef unless @log;
return join('', @log);
}
# Ask user if they really want to commit.
# RETURN TRUE = YES, commit; FALSE = NO, do not commit
sub innodb_inform_and_query_user
{
my ($description) = @_;
my $tmpname = "$bktmp/ibquery.txt";
open MESSAGE, "> $tmpname"
or die "$0: can't write message to '$tmpname': $!";
print MESSAGE <<EOF;
This ChangeSet modifies some files which should normally be changed by
InnoDB developers only. In general, MySQL developers should not change:
$innodb_files_description
The following InnoDB files were modified:
=========================================================
$description
=========================================================
If you understand this, you may Commit these changes. The changes
will be sent to the InnoDB developers at @{[join ', ', @innodb_to_email]},
CC @{[join ', ', @innodb_cc_email]}.
EOF
close_or_warn(MESSAGE, "$tmpname");
my $status = system('bk', 'prompt', '-w',
'-yCommit these changes', '-nDo not Commit', "-f$tmpname");
unlink $tmpname;
return ($status == 0 ? 1 : undef);
}
# innodb_send_changes_email
# $cset The ChangeSet key
# $description A (maybe brief) description of the changes
# RETURN TRUE = Success, e-mail sent; FALSE = Failure
#
# Sends a complete diff of changes in $cset by e-mail.
sub innodb_send_changes_email
{
my ($cset, $description) = @_;
# FIXME: Much of this is duplicated in the 'post-commit' Bourne shell
# trigger
my $cset_short = `bk changes -r'$cset' -d':P:::I:'`;
my $cset_key = `bk changes -r'$cset' -d':KEY:'`;
my ($host, $bk_root) = repository_location();
my $type = repository_type();
(my $treename = $bk_root) =~ s,^.*/,,;
print "Nofifying InnoDB developers at ",
(join ', ', @innodb_to_email, @innodb_cc_email), "\n";
open SENDMAIL, '|-', "$sendmail -t"
or die "Can't exec '$sendmail -t': $!\n";
my @headers;
push @headers, "List-ID: <bk.innodb-$mysql_version>";
push @headers, "From: $from";
push @headers, "To: " . (join ', ', @innodb_to_email);
push @headers, "Cc: " . (join ', ', @innodb_cc_email) if @innodb_cc_email;
push @headers,
"Subject: InnoDB changes in $type $mysql_version tree ($cset_short)";
push @headers, "X-CSetKey: <$cset_key>";
print SENDMAIL map { "$_\n" } @headers, '';
if ($type eq 'main')
{
print SENDMAIL <<EOF;
Changes pushed to $treename by $ENV{USER} affect the following
files. These changes are in a $mysql_version main tree. They
will be available publicly within 24 hours.
EOF
}
elsif ($type eq 'team')
{
print SENDMAIL <<EOF;
Changes added to $treename by $ENV{USER} affect the
following files. These changes are in a $mysql_version team tree.
EOF
}
else
{
print SENDMAIL <<EOF;
A local commit by $ENV{USER} affects the following files. These
changes are in a clone of a $mysql_version tree.
EOF
}
print SENDMAIL "\n";
print SENDMAIL qx(bk changes -r'$cset');
print SENDMAIL "$description";
print SENDMAIL "The complete ChangeSet diffs follow.\n\n";
print SENDMAIL qx(bk rset -r'$cset' -ah | bk gnupatch -h -dup -T);
close_or_warn(SENDMAIL, "$sendmail -t")
or return undef;
return 1;
}
1;

View File

@ -1355,14 +1355,18 @@ void _db_doprnt_(const char *format,...)
}
/*
* This function is intended as a
* vfprintf clone with consistent, platform independent output for
* problematic formats like %p, %zd and %lld.
* However: full functionality for my_vsnprintf has not been backported yet,
* so code using "%g" or "%f" will have undefined behaviour.
*/
static void DbugVfprintf(FILE *stream, const char* format, va_list args)
{
char cvtbuf[1024];
size_t len;
len = my_vsnprintf(cvtbuf, sizeof(cvtbuf), format, args);
// Do not use my_vsnprintf, it does not support "%g".
len = vsnprintf(cvtbuf, sizeof(cvtbuf), format, args);
(void) fprintf(stream, "%s\n", cvtbuf);
}

View File

@ -119,7 +119,6 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
thd->current_stmt= stmt;
thd->store_globals(); // Fix if more than one connect
lex_start(thd);
/*
We have to call free_old_query before we start to fill mysql->fields
for new query. In the case of embedded server we collect field data

View File

@ -358,11 +358,14 @@ sub post_check_client_group {
if (IS_WINDOWS)
{
# Shared memory base may or may not be defined (e.g not defined in embedded)
my $shm = $group_to_copy_from->option("shared-memory-base-name");
if (defined $shm)
if (! $self->{ARGS}->{embedded})
{
$config->insert($client_group_name,"shared-memory-base-name", $shm->value());
# Shared memory base may or may not be defined (e.g not defined in embedded)
my $shm = $group_to_copy_from->option("shared-memory-base-name");
if (defined $shm)
{
$config->insert($client_group_name,"shared-memory-base-name", $shm->value());
}
}
}
}

View File

@ -1843,17 +1843,19 @@ sub environment_setup {
}
else
{
$semisync_master_filename = "libsemisync_master.so";
$semisync_slave_filename = "libsemisync_slave.so";
$semisync_master_filename = "semisync_master.so";
$semisync_slave_filename = "semisync_slave.so";
}
my $lib_semisync_master_plugin=
mtr_file_exists(vs_config_dirs('plugin/semisync',$semisync_master_filename),
"$basedir/plugin/semisync/.libs/" . $semisync_master_filename,
"$basedir/lib/mysql/plugin/" . $semisync_master_filename);
"$basedir/lib/mysql/plugin/" . $semisync_master_filename,
"$basedir/lib/plugin/" . $semisync_master_filename);
my $lib_semisync_slave_plugin=
mtr_file_exists(vs_config_dirs('plugin/semisync',$semisync_slave_filename),
"$basedir/plugin/semisync/.libs/" . $semisync_slave_filename,
"$basedir/lib/mysql/plugin/" . $semisync_slave_filename);
"$basedir/lib/mysql/plugin/" . $semisync_slave_filename,
"$basedir/lib/plugin/" . $semisync_slave_filename);
if ($lib_semisync_master_plugin && $lib_semisync_slave_plugin)
{
$ENV{'SEMISYNC_MASTER_PLUGIN'}= basename($lib_semisync_master_plugin);

View File

@ -402,3 +402,8 @@ s1
a
b
DROP TABLE t1;
SET NAMES utf8 COLLATE utf8_phone_ci;
SHOW COLLATION LIKE 'utf8_phone_ci';
Collation Charset Id Default Compiled Sortlen
utf8_phone_ci utf8 352 8
SET NAMES utf8;

View File

@ -10,7 +10,7 @@ explain extended select * from t1 where a like concat('abc','%');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index a a 13 NULL 5 20.00 Using where; Using index
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like concat('abc','%'))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like <cache>(concat('abc','%')))
select * from t1 where a like "abc%";
a
abc

View File

@ -928,7 +928,6 @@ select f1 from t1 where cast("2006-1-1" as date) between f1 and cast('zzz' as da
f1
Warnings:
Warning 1292 Incorrect datetime value: 'zzz'
Warning 1292 Incorrect datetime value: 'zzz'
select f1 from t1 where makedate(2006,1) between date(f1) and date(f3);
f1
2006-01-01

View File

@ -247,13 +247,10 @@ set global general_log='OFF';
set global slow_query_log='OFF';
set @save_storage_engine= @@session.storage_engine;
set storage_engine= MEMORY;
alter table mysql.slow_log engine=ndb;
ERROR HY000: This storage engine cannot be used for log tables"
alter table mysql.slow_log engine=innodb;
ERROR HY000: This storage engine cannot be used for log tables"
alter table mysql.slow_log engine=archive;
ERROR HY000: This storage engine cannot be used for log tables"
alter table mysql.slow_log engine=blackhole;
alter table mysql.slow_log engine=NonExistentEngine;
Warnings:
Warning 1286 Unknown table engine 'NonExistentEngine'
alter table mysql.slow_log engine=memory;
ERROR HY000: This storage engine cannot be used for log tables"
set storage_engine= @save_storage_engine;
drop table mysql.slow_log;

View File

@ -90,6 +90,42 @@ INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 WHERE pk < 0 ORDER BY pk;
pk
DROP TABLE t1;
CREATE TABLE t1 (a INT)
ENGINE=NonExistentEngine;
Warnings:
Warning 1286 Unknown table engine 'NonExistentEngine'
Warning 1266 Using storage engine MyISAM for table 't1'
DROP TABLE t1;
CREATE TABLE t1 (a INT)
ENGINE=NonExistentEngine
PARTITION BY HASH (a);
Warnings:
Warning 1286 Unknown table engine 'NonExistentEngine'
Warning 1266 Using storage engine MyISAM for table 't1'
DROP TABLE t1;
CREATE TABLE t1 (a INT)
ENGINE=Memory;
ALTER TABLE t1 ENGINE=NonExistentEngine;
Warnings:
Warning 1286 Unknown table engine 'NonExistentEngine'
ALTER TABLE t1
PARTITION BY HASH (a)
(PARTITION p0 ENGINE=Memory,
PARTITION p1 ENGINE=NonExistentEngine);
Warnings:
Warning 1286 Unknown table engine 'NonExistentEngine'
ALTER TABLE t1 ENGINE=NonExistentEngine;
Warnings:
Warning 1286 Unknown table engine 'NonExistentEngine'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
(PARTITION p0 ENGINE = MEMORY,
PARTITION p1 ENGINE = MEMORY) */
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL, KEY(a))
PARTITION BY RANGE(a)
(PARTITION p1 VALUES LESS THAN (200), PARTITION pmax VALUES LESS THAN MAXVALUE);

View File

@ -1,3 +1,25 @@
CREATE TABLE t1 (f1 DATE NOT NULL)
ENGINE = ARCHIVE PARTITION BY RANGE (TO_DAYS(f1))
(partition p1 values less than (733751),
partition p2 values less than MAXVALUE);
INSERT INTO t1 VALUES(CURRENT_DATE);
SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH INDEX_LENGTH
190 0
SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH INDEX_LENGTH
190 0
DROP TABLE t1;
CREATE TABLE t1 (f1 DATE NOT NULL)
ENGINE = ARCHIVE;
INSERT INTO t1 VALUES(CURRENT_DATE);
SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH INDEX_LENGTH
8658 0
SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH INDEX_LENGTH
8658 0
DROP TABLE t1;
drop database if exists db99;
drop table if exists t1;
create database db99;

View File

@ -1,4 +1,14 @@
drop table if exists t1;
create table t1 (a int, b int)
partition by range columns (a,b)
( partition p0 values less than (maxvalue, 10),
partition p1 values less than (maxvalue, maxvalue));
ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
create table t1 (a int, b int, c int)
partition by range columns (a,b,c)
( partition p0 values less than (1, maxvalue, 10),
partition p1 values less than (1, maxvalue, maxvalue));
ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
create table t1 (a varchar(1) character set latin1 collate latin1_general_ci)
partition by range columns(a)
( partition p0 values less than ('a'),
@ -89,7 +99,7 @@ subpartition by hash (to_seconds(d))
subpartitions 4
( partition p0 values less than (1, '0', MAXVALUE, '1900-01-01'),
partition p1 values less than (1, 'a', MAXVALUE, '1999-01-01'),
partition p2 values less than (1, 'a', MAXVALUE, MAXVALUE),
partition p2 values less than (1, 'b', MAXVALUE, MAXVALUE),
partition p3 values less than (1, MAXVALUE, MAXVALUE, MAXVALUE));
select partition_method, partition_expression, partition_description
from information_schema.partitions where table_name = "t1";
@ -102,10 +112,10 @@ RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,MAXVALUE
RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,MAXVALUE
RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,MAXVALUE
RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,MAXVALUE
RANGE COLUMNS a,b,c,d 1,'b',MAXVALUE,MAXVALUE
RANGE COLUMNS a,b,c,d 1,'b',MAXVALUE,MAXVALUE
RANGE COLUMNS a,b,c,d 1,'b',MAXVALUE,MAXVALUE
RANGE COLUMNS a,b,c,d 1,'b',MAXVALUE,MAXVALUE
RANGE COLUMNS a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
RANGE COLUMNS a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
RANGE COLUMNS a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
@ -123,7 +133,7 @@ SUBPARTITION BY HASH (to_seconds(d))
SUBPARTITIONS 4
(PARTITION p0 VALUES LESS THAN (1,'0',MAXVALUE,'1900-01-01') ENGINE = MyISAM,
PARTITION p1 VALUES LESS THAN (1,'a',MAXVALUE,'1999-01-01') ENGINE = MyISAM,
PARTITION p2 VALUES LESS THAN (1,'a',MAXVALUE,MAXVALUE) ENGINE = MyISAM,
PARTITION p2 VALUES LESS THAN (1,'b',MAXVALUE,MAXVALUE) ENGINE = MyISAM,
PARTITION p3 VALUES LESS THAN (1,MAXVALUE,MAXVALUE,MAXVALUE) ENGINE = MyISAM) */
drop table t1;
create table t1 (a int, b int)

View File

@ -210,7 +210,8 @@ engine = innodb
partition by list (a)
(partition p0 values in (0));
alter table t1 engine = x;
ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
Warnings:
Warning 1286 Unknown table engine 'x'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (

View File

@ -4423,9 +4423,14 @@ CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (2),(3);
# Should not crash
SELECT 1 FROM t1 WHERE a <> 1 AND NOT
ROW(a,a) <=> ROW((SELECT 1 FROM t1 WHERE 1=2),(SELECT 1 FROM t1))
ROW(1,a) <=> ROW(1,(SELECT 1 FROM t1))
INTO @var0;
ERROR 21000: Subquery returns more than 1 row
SELECT 1 FROM t1 WHERE a <> 1 AND NOT
ROW(a,a) <=> ROW((SELECT 1 FROM t1 WHERE 1=2),(SELECT 1 FROM t1));
1
1
1
DROP TABLE t1;
End of 5.0 tests
create table t1(a INT, KEY (a));
@ -4577,4 +4582,70 @@ field2
15:13:38
drop table A,AA,B,BB;
#end of test for bug#45266
#
# Bug#33546: Slowdown on re-evaluation of constant expressions.
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (2);
SELECT * FROM t1 WHERE a = 1 + 1;
a
2
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = 1 + 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = <cache>((1 + 1)))
SELECT * FROM t1 HAVING a = 1 + 1;
a
2
EXPLAIN EXTENDED SELECT * FROM t1 HAVING a = 1 + 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` having (`test`.`t1`.`a` = <cache>((1 + 1)))
SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
a b
4 2
EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,'2' AS `b` from `test`.`t1` where (`test`.`t1`.`a` = <cache>(('2' + (1 + 1))))
SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
b a
2 3
EXPLAIN EXTENDED SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00
Warnings:
Note 1003 select '2' AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t1` where 1
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > <cache>(unix_timestamp('2009-03-10 00:00:00')))
CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
BEGIN
SET @cnt := @cnt + 1;
RETURN 1;
END;|
SET @cnt := 0;
SELECT * FROM t1 WHERE a = f1();
a
1
SELECT @cnt;
@cnt
1
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = f1();
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = <cache>(`f1`()))
DROP TABLE t1, t2;
DROP FUNCTION f1;
# End of bug#33546
End of 5.1 tests

View File

@ -735,7 +735,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1249 Select 3 was reduced during optimization
Note 1249 Select 2 was reduced during optimization
Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = (1 + 1))
Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = <cache>((1 + 1)))
EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index NULL id 5 NULL 2 100.00 Using where; Using index
@ -3562,9 +3562,7 @@ SELECT sql_no_cache * FROM t1 WHERE NOT EXISTS
(SELECT i FROM t1) UNION
(SELECT i FROM t1)
);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION
(SELECT i FROM t1)
)' at line 3
i
SELECT * FROM t1
WHERE NOT EXISTS (((SELECT i FROM t1) UNION (SELECT i FROM t1)));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION (SELECT i FROM t1)))' at line 2
@ -3574,7 +3572,11 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
from t1' at line 1
explain select * from t1 where not exists
((select t11.i from t1 t11) union (select t12.i from t1 t12));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union (select t12.i from t1 t12))' at line 2
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b));
insert into t1 (a) values (FLOOR(rand() * 100));
@ -4279,8 +4281,15 @@ Note 1003 select 2 AS `2` from `test`.`t1` where exists(select 1 AS `1` from `te
EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
(SELECT 1 FROM t2 WHERE t1.a = t2.a));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION
(SELECT 1 FROM t2 WHERE t1.a = t2.a))' at line 2
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1
Note 1003 select 2 AS `2` from `test`.`t1` where exists((select 1 AS `1` from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) union (select 1 AS `1` from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)))
DROP TABLE t1,t2;
create table t1(f11 int, f12 int);
create table t2(f21 int unsigned not null, f22 int, f23 varchar(10));
@ -4563,6 +4572,270 @@ id g v s
51 50 NULL l
61 60 NULL l
drop table t1, t2;
#
# Bug#33204: INTO is allowed in subselect, causing inconsistent results
#
CREATE TABLE t1( a INT );
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2( a INT, b INT );
SELECT *
FROM (SELECT a INTO @var FROM t1 WHERE a = 2) t1a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @var FROM t1 WHERE a = 2) t1a' at line 2
SELECT *
FROM (SELECT a INTO OUTFILE 'file' FROM t1 WHERE a = 2) t1a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' FROM t1 WHERE a = 2) t1a' at line 2
SELECT *
FROM (SELECT a INTO DUMPFILE 'file' FROM t1 WHERE a = 2) t1a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' FROM t1 WHERE a = 2) t1a' at line 2
SELECT * FROM (
SELECT 1 a
UNION
SELECT a INTO @var FROM t1 WHERE a = 2
) t1a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @var FROM t1 WHERE a = 2
) t1a' at line 4
SELECT * FROM (
SELECT 1 a
UNION
SELECT a INTO OUTFILE 'file' FROM t1 WHERE a = 2
) t1a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' FROM t1 WHERE a = 2
) t1a' at line 4
SELECT * FROM (
SELECT 1 a
UNION
SELECT a INTO DUMPFILE 'file' FROM t1 WHERE a = 2
) t1a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' FROM t1 WHERE a = 2
) t1a' at line 4
SELECT * FROM (SELECT a FROM t1 WHERE a = 2) t1a;
a
2
SELECT * FROM (
SELECT a FROM t1 WHERE a = 2
UNION
SELECT a FROM t1 WHERE a = 2
) t1a;
a
2
SELECT * FROM (
SELECT 1 a
UNION
SELECT a FROM t1 WHERE a = 2
UNION
SELECT a FROM t1 WHERE a = 2
) t1a;
a
1
2
SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
SELECT * FROM (SELECT 1 a UNION (SELECT 1 a)) alias;
a
1
SELECT * FROM (SELECT 1 UNION SELECT 1) t1a;
1
1
SELECT * FROM ((SELECT 1 a INTO @a)) t1a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)) t1a' at line 1
SELECT * FROM ((SELECT 1 a INTO OUTFILE 'file' )) t1a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )) t1a' at line 1
SELECT * FROM ((SELECT 1 a INTO DUMPFILE 'file' )) t1a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )) t1a' at line 1
SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO @a)) t1a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)) t1a' at line 1
SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO DUMPFILE 'file' )) t1a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )) t1a' at line 1
SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO OUTFILE 'file' )) t1a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )) t1a' at line 1
SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO @a))) t1a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a))) t1a' at line 1
SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO DUMPFILE 'file' ))) t1a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' ))) t1a' at line 1
SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO OUTFILE 'file' ))) t1a;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' ))) t1a' at line 1
SELECT * FROM (SELECT 1 a ORDER BY a) t1a;
a
1
SELECT * FROM (SELECT 1 a UNION SELECT 1 a ORDER BY a) t1a;
a
1
SELECT * FROM (SELECT 1 a UNION SELECT 1 a LIMIT 1) t1a;
a
1
SELECT * FROM (SELECT 1 a UNION SELECT 1 a ORDER BY a LIMIT 1) t1a;
a
1
SELECT * FROM t1 JOIN (SELECT 1 UNION SELECT 1) alias ON 1;
a 1
1 1
2 1
SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) ON 1' at line 1
SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ON 1' at line 1
SELECT * FROM t1 JOIN (t1 t1a) t1a ON 1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't1a ON 1' at line 1
SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't1a ON 1' at line 1
SELECT * FROM t1 JOIN (t1 t1a) ON 1;
a a
1 1
2 1
1 2
2 2
SELECT * FROM t1 JOIN ((t1 t1a)) ON 1;
a a
1 1
2 1
1 2
2 2
SELECT * FROM (t1 t1a);
a
1
2
SELECT * FROM ((t1 t1a));
a
1
2
SELECT * FROM t1 JOIN (SELECT 1 t1a) alias ON 1;
a t1a
1 1
2 1
SELECT * FROM t1 JOIN ((SELECT 1 t1a)) alias ON 1;
a t1a
1 1
2 1
SELECT * FROM t1 JOIN (SELECT 1 a) a ON 1;
a a
1 1
2 1
SELECT * FROM t1 JOIN ((SELECT 1 a)) a ON 1;
a a
1 1
2 1
SELECT * FROM (t1 JOIN (SELECT 1) t1a1 ON 1) t1a2;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't1a2' at line 1
SELECT * FROM t1 WHERE a = ALL ( SELECT 1 );
a
1
SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION SELECT 1 );
a
1
SELECT * FROM t1 WHERE a = ANY ( SELECT 3 UNION SELECT 1 );
a
1
SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO @a);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)' at line 1
SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
SELECT * FROM t1 WHERE a = ( SELECT 1 );
a
1
SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 );
a
1
SELECT * FROM t1 WHERE a = ( SELECT 1 INTO @a);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)' at line 1
SELECT * FROM t1 WHERE a = ( SELECT 1 INTO OUTFILE 'file' );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
SELECT * FROM t1 WHERE a = ( SELECT 1 INTO DUMPFILE 'file' );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO @a);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @a)' at line 1
SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
SELECT ( SELECT 1 INTO @v );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
SELECT ( SELECT 1 INTO OUTFILE 'file' );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
SELECT ( SELECT 1 INTO DUMPFILE 'file' );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
SELECT ( SELECT 1 UNION SELECT 1 INTO @v );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
SELECT ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'file' )' at line 1
SELECT ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO DUMPFILE 'file' )' at line 1
SELECT ( SELECT a FROM t1 WHERE a = 1 ), a FROM t1;
( SELECT a FROM t1 WHERE a = 1 ) a
1 1
1 2
SELECT ( SELECT a FROM t1 WHERE a = 1 UNION SELECT 1 ), a FROM t1;
( SELECT a FROM t1 WHERE a = 1 UNION SELECT 1 ) a
1 1
1 2
SELECT * FROM t2 WHERE (a, b) IN (SELECT a, b FROM t2);
a b
SELECT 1 UNION ( SELECT 1 UNION SELECT 1 );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 )' at line 1
( SELECT 1 UNION SELECT 1 ) UNION SELECT 1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) UNION SELECT 1' at line 1
SELECT ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
SELECT ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1' at line 1
SELECT ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
( SELECT 1 UNION SELECT 1 UNION SELECT 1 )
1
SELECT ((SELECT 1 UNION SELECT 1 UNION SELECT 1));
((SELECT 1 UNION SELECT 1 UNION SELECT 1))
1
SELECT * FROM ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') UNION SELECT 1 )' at line 1
SELECT * FROM ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ) a;
1
1
SELECT * FROM t1 WHERE a = ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) )' at line 1
SELECT * FROM t1 WHERE a = ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 )' at line 1
SELECT * FROM t1 WHERE a = ALL ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) UNION SELECT 1 )' at line 1
SELECT * FROM t1 WHERE a = ANY ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 ) UNION SELECT 1 )' at line 1
SELECT * FROM t1 WHERE a IN ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UNION SELECT 1 )' at line 1
SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
a
1
SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
a
1
SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
a
1
SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
a
1
SELECT * FROM t1 WHERE EXISTS ( SELECT 1 UNION SELECT 1 INTO @v );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
SELECT EXISTS(SELECT 1+1);
EXISTS(SELECT 1+1)
1
SELECT EXISTS(SELECT 1+1 INTO @test);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @test)' at line 1
SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION SELECT 1 INTO @v );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
SELECT * FROM t1 WHERE EXISTS ( SELECT 1 INTO @v );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
SELECT * FROM t1 WHERE a IN ( SELECT 1 INTO @v );
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO @v )' at line 1
DROP TABLE t1, t2;
CREATE TABLE t1 (a ENUM('rainbow'));
INSERT INTO t1 VALUES (),(),(),(),();
SELECT 1 FROM t1 GROUP BY (SELECT 1 FROM t1 ORDER BY AVG(LAST_INSERT_ID()));

View File

@ -958,3 +958,21 @@ ERROR 42000: Display width out of range for column 'cast as char' (max = 4294967
explain select convert(1, binary(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
ERROR 42000: Display width out of range for column 'cast as char' (max = 4294967295)
End of 5.0 tests
CREATE TABLE t1(id INT NOT NULL);
CREATE TABLE t2(id INT NOT NULL, c TEXT NOT NULL);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1, '');
UPDATE t2 SET c = REPEAT('1', 70000);
Warnings:
Warning 1265 Data truncated for column 'c' at row 1
SELECT LENGTH(c) FROM t2;
LENGTH(c)
65535
UPDATE t1 LEFT JOIN t2 USING(id) SET t2.c = REPEAT('1', 70000) WHERE t1.id = 1;
Warnings:
Warning 1265 Data truncated for column 'c' at row 1
SELECT LENGTH(c) FROM t2;
LENGTH(c)
65535
DROP TABLE t1, t2;
End of 5.1 tests

View File

@ -276,8 +276,8 @@ t1 int(1) NULL NO 0 #
t2 varchar(1) latin1_swedish_ci NO #
t3 varchar(256) latin1_swedish_ci NO #
t4 varbinary(256) NULL NO #
t5 longtext latin1_swedish_ci NO NULL #
t6 longblob NULL NO NULL #
t5 text latin1_swedish_ci NO NULL #
t6 blob NULL NO NULL #
t7 char(0) latin1_swedish_ci NO #
t8 binary(0) NULL NO #
select t1,t2,length(t3),length(t4),length(t5),length(t6),t7,t8 from t2;

View File

@ -409,3 +409,18 @@ b
1
DROP TABLE t1;
End of 5.0 tests.
#
# Bug#33546: Slowdown on re-evaluation of constant expressions.
#
CREATE TABLE t1 (f1 INT);
INSERT INTO t1 VALUES(1),(50);
CREATE FUNCTION myfunc_double RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE f1=1 + myfunc_double(1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select 1 AS `1` from `test`.`t1` where (`test`.`t1`.`f1` = <cache>((1 + myfunc_double(1 AS `1`))))
DROP FUNCTION myfunc_double;
DROP TABLE t1;
#
End of 5.1 tests.

View File

@ -153,48 +153,6 @@ ERROR 42S22: Unknown column 'a' in 'field list'
1 3
1 3
2 1
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
SELECT a INTO @v FROM (
SELECT a FROM t1
UNION
SELECT a FROM t1
) alias;
SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM (
SELECT a FROM t1
UNION
SELECT a FROM t1 WHERE 0
) alias;
SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM (
SELECT a FROM t1
UNION
SELECT a FROM t1 WHERE 0
) alias;
SELECT a FROM (
SELECT a FROM t1
UNION
SELECT a INTO @v FROM t1
) alias;
SELECT a FROM (
SELECT a FROM t1
UNION
SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1
) alias;
SELECT a FROM (
SELECT a FROM t1
UNION
SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1
) alias;
SELECT a FROM t1 UNION SELECT a INTO @v FROM t1;
SELECT a FROM t1 UNION SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1;
SELECT a FROM t1 UNION SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1;
SELECT a INTO @v FROM t1 UNION SELECT a FROM t1;
ERROR HY000: Incorrect usage of UNION and INTO
SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1 UNION SELECT a FROM t1;
ERROR HY000: Incorrect usage of UNION and INTO
SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1 UNION SELECT a FROM t1;
ERROR HY000: Incorrect usage of UNION and INTO
DROP TABLE t1;
CREATE TABLE t1 (
`pseudo` char(35) NOT NULL default '',
`pseudo1` char(35) NOT NULL default '',
@ -1588,3 +1546,39 @@ Warnings:
Note 1003 select '0' AS `a` from `test`.`t1` union select '0' AS `a` from `test`.`t1` order by `a`
DROP TABLE t1;
End of 5.0 tests
#
# Bug#32858: Error: "Incorrect usage of UNION and INTO" does not take
# subselects into account
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
# Tests fix in parser rule select_derived_union.
SELECT a INTO @v FROM (
SELECT a FROM t1
UNION
SELECT a FROM t1
) alias;
SELECT a INTO OUTFILE 'union.out.file' FROM (
SELECT a FROM t1
UNION
SELECT a FROM t1 WHERE 0
) alias;
SELECT a INTO DUMPFILE 'union.out.file2' FROM (
SELECT a FROM t1
UNION
SELECT a FROM t1 WHERE 0
) alias;
SELECT a FROM t1 UNION SELECT a INTO @v FROM t1;
SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file5' FROM t1;
SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file6' FROM t1;
SELECT a INTO @v FROM t1 UNION SELECT a FROM t1;
ERROR HY000: Incorrect usage of UNION and INTO
SELECT a INTO OUTFILE 'union.out.file7' FROM t1 UNION SELECT a FROM t1;
ERROR HY000: Incorrect usage of UNION and INTO
SELECT a INTO DUMPFILE 'union.out.file8' FROM t1 UNION SELECT a FROM t1;
ERROR HY000: Incorrect usage of UNION and INTO
# Tests fix in parser rule query_expression_body.
SELECT ( SELECT a UNION SELECT a ) INTO @v FROM t1;
SELECT ( SELECT a UNION SELECT a ) INTO OUTFILE 'union.out.file3' FROM t1;
SELECT ( SELECT a UNION SELECT a ) INTO DUMPFILE 'union.out.file4' FROM t1;
DROP TABLE t1;

View File

@ -14,6 +14,8 @@
# Change: Splitted the test in two different parts (increasing/decreasing col) #
################################################################################
if (!$only_part_2)
{
--echo
--echo #========================================================================
--echo # 1 Increase the size of the column used in the partitioning
@ -89,13 +91,16 @@ if ($more_pk_ui_tests)
let $unique= , UNIQUE INDEX uidx (f_int1);
--source suite/parts/inc/partition_alter_11.inc
let $unique= , UNIQUE INDEX uidx (f_int1,f_int2);
--source suite/parts/inc/partition_alter_11.inc
#--source suite/parts/inc/partition_alter_11.inc
--source suite/parts/inc/partition_alter_13.inc
let $unique= , UNIQUE INDEX uidx (f_int2,f_int1);
--source suite/parts/inc/partition_alter_11.inc
#--source suite/parts/inc/partition_alter_11.inc
--source suite/parts/inc/partition_alter_13.inc
}
}
#
if (!$only_part_1)
{
--echo #------------------------------------------------------------------------
--echo # 1.3 ALTER column f_int1 and f_int2
--echo # f_int1 or (f_int1 and f_int2) used in partitioning function
@ -105,7 +110,7 @@ if ($more_pk_ui_tests)
let $alter= ALTER TABLE t1 MODIFY f_int1 BIGINT, MODIFY f_int2 BIGINT;
--echo # 1.3.1 no PRIMARY KEY or UNIQUE INDEX exists
let $unique= ;
--source suite/parts/inc/partition_alter_11.inc
#--source suite/parts/inc/partition_alter_11.inc
--source suite/parts/inc/partition_alter_13.inc
#
if ($do_pk_tests)
@ -119,10 +124,10 @@ if ($do_pk_tests)
--source suite/parts/inc/partition_alter_11.inc
}
let $unique= , PRIMARY KEY (f_int1,f_int2);
--source suite/parts/inc/partition_alter_11.inc
#--source suite/parts/inc/partition_alter_11.inc
--source suite/parts/inc/partition_alter_13.inc
let $unique= , PRIMARY KEY (f_int2,f_int1);
--source suite/parts/inc/partition_alter_11.inc
#--source suite/parts/inc/partition_alter_11.inc
--source suite/parts/inc/partition_alter_13.inc
}
#
@ -135,11 +140,12 @@ if ($more_pk_ui_tests)
--source suite/parts/inc/partition_alter_11.inc
}
let $unique= , UNIQUE INDEX uidx (f_int1,f_int2);
--source suite/parts/inc/partition_alter_11.inc
#--source suite/parts/inc/partition_alter_11.inc
--source suite/parts/inc/partition_alter_13.inc
let $unique= , UNIQUE INDEX uidx (f_int2,f_int1);
--source suite/parts/inc/partition_alter_11.inc
#--source suite/parts/inc/partition_alter_11.inc
--source suite/parts/inc/partition_alter_13.inc
}
if (0)
{

View File

@ -14,6 +14,8 @@
# Change: Splitted the test in two different parts (increasing/decreasing col) #
################################################################################
if (!$only_part_2)
{
--echo
--echo #========================================================================
--echo # 2 Decrease the size of the column used in the partitioning
@ -95,7 +97,10 @@ if ($more_pk_ui_tests)
--source suite/parts/inc/partition_alter_11.inc
--source suite/parts/inc/partition_alter_13.inc
}
}
#
if (!$only_part_1)
{
--echo #------------------------------------------------------------------------
--echo # 2.3 ALTER column f_int1 and f_int2 used in partitioning function
--echo #------------------------------------------------------------------------
@ -104,7 +109,7 @@ if ($more_pk_ui_tests)
let $alter= ALTER TABLE t1 MODIFY f_int1 MEDIUMINT, MODIFY f_int2 MEDIUMINT;
--echo # 2.3.1 no PRIMARY KEY or UNIQUE INDEX exists
let $unique= ;
--source suite/parts/inc/partition_alter_11.inc
#--source suite/parts/inc/partition_alter_11.inc
--source suite/parts/inc/partition_alter_13.inc
#
if ($do_pk_tests)
@ -118,10 +123,10 @@ if ($do_pk_tests)
--source suite/parts/inc/partition_alter_11.inc
}
let $unique= , PRIMARY KEY (f_int1,f_int2);
--source suite/parts/inc/partition_alter_11.inc
#--source suite/parts/inc/partition_alter_11.inc
--source suite/parts/inc/partition_alter_13.inc
let $unique= , PRIMARY KEY (f_int2,f_int1);
--source suite/parts/inc/partition_alter_11.inc
#--source suite/parts/inc/partition_alter_11.inc
--source suite/parts/inc/partition_alter_13.inc
}
#
@ -134,11 +139,12 @@ if ($more_pk_ui_tests)
--source suite/parts/inc/partition_alter_11.inc
}
let $unique= , UNIQUE INDEX uidx (f_int1,f_int2);
--source suite/parts/inc/partition_alter_11.inc
#--source suite/parts/inc/partition_alter_11.inc
--source suite/parts/inc/partition_alter_13.inc
let $unique= , UNIQUE INDEX uidx (f_int2,f_int1);
--source suite/parts/inc/partition_alter_11.inc
#--source suite/parts/inc/partition_alter_11.inc
--source suite/parts/inc/partition_alter_13.inc
}
#
if (0)

View File

@ -92,16 +92,13 @@ $partitioning;
#----------- PARTITION BY RANGE
if ($with_partitioning)
{
--disable_query_log
eval SET @aux = 'PARTITION BY RANGE((f_int1 + f_int2) DIV 2)
let $partitioning= PARTITION BY RANGE((f_int1 + f_int2) DIV 2)
(PARTITION parta VALUES LESS THAN (0),
PARTITION partb VALUES LESS THAN ($max_row_div4),
PARTITION partc VALUES LESS THAN ($max_row_div2),
PARTITION partd VALUES LESS THAN ($max_row_div2 + $max_row_div4),
PARTITION parte VALUES LESS THAN ($max_row),
PARTITION partf VALUES LESS THAN $MAX_VALUE)';
let $partitioning= `SELECT @aux`;
--enable_query_log
PARTITION partf VALUES LESS THAN $MAX_VALUE);
}
eval CREATE TABLE t1 (
$column_list
@ -113,15 +110,11 @@ $partitioning;
#----------- PARTITION BY RANGE -- SUBPARTITION BY HASH
if ($with_partitioning)
{
--disable_query_log
eval SET @aux =
'PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int2) SUBPARTITIONS 2
let $partitioning= PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int2) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0),
PARTITION partb VALUES LESS THAN ($max_row_div4),
PARTITION partc VALUES LESS THAN ($max_row_div2),
PARTITION partd VALUES LESS THAN $MAX_VALUE)';
let $partitioning= `SELECT @aux`;
--enable_query_log
PARTITION partd VALUES LESS THAN $MAX_VALUE);
}
eval CREATE TABLE t1 (
$column_list
@ -133,8 +126,7 @@ $partitioning;
#----------- PARTITION BY RANGE -- SUBPARTITION BY KEY
if ($with_partitioning)
{
--disable_query_log
eval SET @aux = 'PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int2)
let $partitioning= PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int2)
(PARTITION part1 VALUES LESS THAN (0)
(SUBPARTITION subpart11, SUBPARTITION subpart12),
PARTITION part2 VALUES LESS THAN ($max_row_div4)
@ -142,9 +134,7 @@ PARTITION part2 VALUES LESS THAN ($max_row_div4)
PARTITION part3 VALUES LESS THAN ($max_row_div2)
(SUBPARTITION subpart31, SUBPARTITION subpart32),
PARTITION part4 VALUES LESS THAN $MAX_VALUE
(SUBPARTITION subpart41, SUBPARTITION subpart42))';
let $partitioning= `SELECT @aux`;
--enable_query_log
(SUBPARTITION subpart41, SUBPARTITION subpart42));
}
eval CREATE TABLE t1 (
$column_list
@ -176,15 +166,11 @@ $partitioning;
#----------- PARTITION BY LIST -- SUBPARTITION BY KEY
if ($with_partitioning)
{
--disable_query_log
eval SET @aux =
'PARTITION BY LIST(ABS(MOD(f_int1,2)))
let $partitioning= PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS $sub_part_no
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL))';
let $partitioning= `SELECT @aux`;
--enable_query_log
PARTITION part3 VALUES IN (NULL));
}
eval CREATE TABLE t1 (
$column_list

View File

@ -3571,8 +3571,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
@ -7585,8 +7585,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
@ -11712,8 +11712,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
@ -15854,8 +15854,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
@ -19892,8 +19892,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
@ -23914,8 +23914,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
@ -27936,8 +27936,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;

View File

@ -3808,8 +3808,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
@ -8098,8 +8098,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;

View File

@ -14138,8 +14138,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
@ -17736,8 +17736,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
@ -21447,8 +21447,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
@ -25173,8 +25173,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
@ -28788,8 +28788,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
@ -32386,8 +32386,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
@ -36096,8 +36096,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;

View File

@ -7322,8 +7322,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
@ -11196,8 +11196,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;
@ -15070,8 +15070,8 @@ f_charbig VARCHAR(1000)
PARTITION BY LIST(ABS(MOD(f_int1,2)))
SUBPARTITION BY KEY(f_int2) SUBPARTITIONS 3
(PARTITION part1 VALUES IN (0),
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
PARTITION part2 VALUES IN (1),
PARTITION part3 VALUES IN (NULL));
INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig)
SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template
WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
################################################################################
# t/partition_alter2_1_innodb.test #
# t/partition_alter2_1_1_innodb.test #
# #
# Purpose: #
# Tests around Alter column used in partitioning function #
@ -39,6 +39,8 @@ SET @max_row = 20;
##### Execute more tests #####
let $more_trigger_tests= 0;
let $more_pk_ui_tests= 0;
# only do the first part
let $only_part_1= 1;
# The server must support partitioning.
--source include/have_partition.inc

View File

@ -0,0 +1,82 @@
################################################################################
# t/partition_alter2_1_2_innodb.test #
# #
# Purpose: #
# Tests around Alter column used in partitioning function #
# InnoDB branch #
# #
#------------------------------------------------------------------------------#
# Original Author: mleich #
# Original Date: 2006-03-05 #
# Change Author: #
# Change Date: #
# Change: #
################################################################################
#
# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE !
# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
# THE SOURCED FILES ONLY.
#
# Please read the README at the end of inc/partition.pre before changing
# any of the variables.
#
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
##### Options, for debugging support #####
let $debug= 0;
let $with_partitioning= 1;
##### Option, for displaying files #####
let $ls= 1;
##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
# on partioned tables
SET @max_row = 20;
##### Execute more tests #####
let $more_trigger_tests= 0;
let $more_pk_ui_tests= 0;
# only do the second part
let $only_part_2= 1;
# The server must support partitioning.
--source include/have_partition.inc
#------------------------------------------------------------------------------#
# Engine specific settings and requirements
##### Storage engine to be tested
--source include/have_innodb.inc
let $engine= 'InnoDB';
##### Execute the test of "table" files
# InnoDB has no files per PK, UI, ...
let $do_file_tests= 0;
##### Execute PRIMARY KEY tests #####
# AFAIK InnoDB clusters the table around PRIMARY KEYs.
let $do_pk_tests= 1;
##### Assign a big number smaller than the maximum value for partitions #####
# and smaller than the maximum value of SIGNED INTEGER
let $MAX_VALUE= (2147483646);
# Generate the prerequisites ($variables, @variables, tables) needed
--source suite/parts/inc/partition.pre
##### Workarounds for known open engine specific bugs
# none
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
--source suite/parts/inc/partition_alter2_1.inc
#------------------------------------------------------------------------------#
# Execute storage engine specific tests
#------------------------------------------------------------------------------#
# Cleanup
--source suite/parts/inc/partition_cleanup.inc

View File

@ -1,5 +1,5 @@
################################################################################
# t/partition_alter2_2_innodb.test #
# t/partition_alter2_2_1_innodb.test #
# #
# Purpose: #
# Tests around Alter column used in partitioning function #
@ -39,6 +39,8 @@ SET @max_row = 20;
##### Execute more tests #####
let $more_trigger_tests= 0;
let $more_pk_ui_tests= 0;
# only do the first part
let $only_part_1= 1;
# The server must support partitioning.
--source include/have_partition.inc

View File

@ -0,0 +1,82 @@
################################################################################
# t/partition_alter2_2_2_innodb.test #
# #
# Purpose: #
# Tests around Alter column used in partitioning function #
# InnoDB branch #
# #
#------------------------------------------------------------------------------#
# Original Author: mleich #
# Original Date: 2006-03-05 #
# Change Author: #
# Change Date: #
# Change: #
################################################################################
#
# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE !
# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
# THE SOURCED FILES ONLY.
#
# Please read the README at the end of inc/partition.pre before changing
# any of the variables.
#
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
##### Options, for debugging support #####
let $debug= 0;
let $with_partitioning= 1;
##### Option, for displaying files #####
let $ls= 1;
##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
# on partioned tables
SET @max_row = 20;
##### Execute more tests #####
let $more_trigger_tests= 0;
let $more_pk_ui_tests= 0;
# only do the second part
let $only_part_2= 1;
# The server must support partitioning.
--source include/have_partition.inc
#------------------------------------------------------------------------------#
# Engine specific settings and requirements
##### Storage engine to be tested
--source include/have_innodb.inc
let $engine= 'InnoDB';
##### Execute the test of "table" files
# InnoDB has no files per PK, UI, ...
let $do_file_tests= 0;
##### Execute PRIMARY KEY tests #####
# AFAIK InnoDB clusters the table around PRIMARY KEYs.
let $do_pk_tests= 1;
##### Assign a big number smaller than the maximum value for partitions #####
# and smaller than the maximum value of SIGNED INTEGER
let $MAX_VALUE= (2147483646);
# Generate the prerequisites ($variables, @variables, tables) needed
--source suite/parts/inc/partition.pre
##### Workarounds for known open engine specific bugs
# none
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
--source suite/parts/inc/partition_alter2_2.inc
#------------------------------------------------------------------------------#
# Execute storage engine specific tests
#------------------------------------------------------------------------------#
# Cleanup
--source suite/parts/inc/partition_cleanup.inc

View File

@ -0,0 +1,46 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
include/stop_slave.inc
include/start_slave.inc
SET GLOBAL event_scheduler = ON;
CREATE TABLE t1 (i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f varchar(8)) ENGINE=ENGINE_TYPE;
INSERT INTO t1 (f) VALUES ('a'),('a'),('a'),('a'),('a');
INSERT INTO t1 SELECT i+5, f FROM t1;
INSERT INTO t1 SELECT i+10, f FROM t1;
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev1_',CONNECTION_ID()));
CREATE EVENT ev2 ON SCHEDULE EVERY 1 SECOND
DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev2_',CONNECTION_ID()));
STOP SLAVE IO_THREAD;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 20;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 19;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 18;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 17;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 16;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 15;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 14;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 13;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 12;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 11;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 10;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 9;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 8;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 7;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 6;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 5;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 4;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 3;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 2;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 1;
SET GLOBAL event_scheduler = OFF;
include/stop_slave.inc
UNINSTALL PLUGIN rpl_semi_sync_slave;
UNINSTALL PLUGIN rpl_semi_sync_master;
include/start_slave.inc
DROP EVENT ev1;
DROP EVENT ev2;
DROP TABLE t1;

View File

@ -0,0 +1 @@
$SEMISYNC_PLUGIN_OPT --max-connections=23

View File

@ -0,0 +1 @@
$SEMISYNC_PLUGIN_OPT

View File

@ -0,0 +1,108 @@
source include/have_semisync_plugin.inc;
source include/not_embedded.inc;
source include/master-slave.inc;
source include/have_innodb.inc;
let $engine_type= InnoDB;
# Suppress warnings that might be generated during the test
disable_query_log;
connection master;
call mtr.add_suppression("Timeout waiting for reply of binlog");
call mtr.add_suppression("Semi-sync master .* waiting for slave reply");
call mtr.add_suppression("Read semi-sync reply");
connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
enable_query_log;
connection master;
disable_query_log;
let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1);
if (`select '$value' = 'No such row'`)
{
set sql_log_bin=0;
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
SET GLOBAL rpl_semi_sync_master_enabled = 1;
set sql_log_bin=1;
}
enable_query_log;
connection slave;
source include/stop_slave.inc;
disable_query_log;
let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1);
if (`select '$value' = 'No such row'`)
{
set sql_log_bin=0;
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
SET GLOBAL rpl_semi_sync_slave_enabled = 1;
set sql_log_bin=1;
}
enable_query_log;
source include/start_slave.inc;
connection master;
SET GLOBAL event_scheduler = ON;
replace_result $engine_type ENGINE_TYPE;
eval CREATE TABLE t1 (i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f varchar(8)) ENGINE=$engine_type;
INSERT INTO t1 (f) VALUES ('a'),('a'),('a'),('a'),('a');
INSERT INTO t1 SELECT i+5, f FROM t1;
INSERT INTO t1 SELECT i+10, f FROM t1;
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev1_',CONNECTION_ID()));
CREATE EVENT ev2 ON SCHEDULE EVERY 1 SECOND
DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev2_',CONNECTION_ID()));
connection slave;
STOP SLAVE IO_THREAD;
connection master;
let $run = 20;
while ($run)
{
connect (m$run,localhost,root,,);
connection m$run;
send;
eval UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = $run;
connection master;
dec $run;
}
connection master;
SET GLOBAL event_scheduler = OFF;
let $run = 20;
while ($run)
{
connection m$run;
reap;
disconnect m$run;
dec $run;
}
#
# Clean up
#
connection slave;
source include/stop_slave.inc;
disable_warnings;
UNINSTALL PLUGIN rpl_semi_sync_slave;
connection master;
UNINSTALL PLUGIN rpl_semi_sync_master;
enable_warnings;
connection slave;
source include/start_slave.inc;
connection master;
DROP EVENT ev1;
DROP EVENT ev2;
DROP TABLE t1;
sync_slave_with_master;

View File

@ -144,3 +144,11 @@ CREATE TABLE t1 (s1 char(10) character set utf8 collate utf8_maxuserid_ci);
INSERT INTO t1 VALUES ('a'),('b');
SELECT * FROM t1 WHERE s1='a' ORDER BY BINARY s1;
DROP TABLE t1;
#
# Bug#47756 Setting 2byte collation ID with 'set names' crashes the server
#
SET NAMES utf8 COLLATE utf8_phone_ci;
SHOW COLLATION LIKE 'utf8_phone_ci';
SET NAMES utf8;

View File

@ -258,14 +258,21 @@ set global slow_query_log='OFF';
# check that alter table doesn't work for other engines
set @save_storage_engine= @@session.storage_engine;
set storage_engine= MEMORY;
# After fixing bug#35765 the error behaivor changed:
# If compiled in/enabled ER_UNSUPORTED_LOG_ENGINE
# If not (i.e. not existant) it will show a warning
# and use the current one.
alter table mysql.slow_log engine=NonExistentEngine;
--error ER_UNSUPORTED_LOG_ENGINE
alter table mysql.slow_log engine=ndb;
--error ER_UNSUPORTED_LOG_ENGINE
alter table mysql.slow_log engine=innodb;
--error ER_UNSUPORTED_LOG_ENGINE
alter table mysql.slow_log engine=archive;
--error ER_UNSUPORTED_LOG_ENGINE
alter table mysql.slow_log engine=blackhole;
alter table mysql.slow_log engine=memory;
#--error ER_UNSUPORTED_LOG_ENGINE
#alter table mysql.slow_log engine=ndb;
#--error ER_UNSUPORTED_LOG_ENGINE
#alter table mysql.slow_log engine=innodb;
#--error ER_UNSUPORTED_LOG_ENGINE
#alter table mysql.slow_log engine=archive;
#--error ER_UNSUPORTED_LOG_ENGINE
#alter table mysql.slow_log engine=blackhole;
set storage_engine= @save_storage_engine;
drop table mysql.slow_log;

View File

@ -110,6 +110,29 @@ INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 WHERE pk < 0 ORDER BY pk;
DROP TABLE t1;
#
# Bug#35765: ALTER TABLE produces wrong error when non-existent storage engine
# used
CREATE TABLE t1 (a INT)
ENGINE=NonExistentEngine;
DROP TABLE t1;
CREATE TABLE t1 (a INT)
ENGINE=NonExistentEngine
PARTITION BY HASH (a);
DROP TABLE t1;
CREATE TABLE t1 (a INT)
ENGINE=Memory;
ALTER TABLE t1 ENGINE=NonExistentEngine;
# OK to only specify one partitions engine, since it is already assigned at
# table level (after create, it is specified on all levels and all parts).
ALTER TABLE t1
PARTITION BY HASH (a)
(PARTITION p0 ENGINE=Memory,
PARTITION p1 ENGINE=NonExistentEngine);
ALTER TABLE t1 ENGINE=NonExistentEngine;
SHOW CREATE TABLE t1;
DROP TABLE t1;
#
# Bug#40494: Crash MYSQL server crashes on range access with partitioning
# and order by

View File

@ -10,6 +10,27 @@
--source include/have_partition.inc
--source include/have_archive.inc
let $MYSQLD_DATADIR= `select @@datadir`;
#
# Bug#44622: Using PARTITIONs with ARCHIVE engine reports 0 bytes in i_s.TABLES
#
CREATE TABLE t1 (f1 DATE NOT NULL)
ENGINE = ARCHIVE PARTITION BY RANGE (TO_DAYS(f1))
(partition p1 values less than (733751),
partition p2 values less than MAXVALUE);
INSERT INTO t1 VALUES(CURRENT_DATE);
SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DROP TABLE t1;
CREATE TABLE t1 (f1 DATE NOT NULL)
ENGINE = ARCHIVE;
INSERT INTO t1 VALUES(CURRENT_DATE);
SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DROP TABLE t1;
#
# Bug 17310 Partitions: Bugs with archived partitioned tables

View File

@ -8,6 +8,21 @@
drop table if exists t1;
--enable_warnings
#
# BUG#49180, Possible to define empty intervals for column list partitioning
#
--error ER_RANGE_NOT_INCREASING_ERROR
create table t1 (a int, b int)
partition by range columns (a,b)
( partition p0 values less than (maxvalue, 10),
partition p1 values less than (maxvalue, maxvalue));
--error ER_RANGE_NOT_INCREASING_ERROR
create table t1 (a int, b int, c int)
partition by range columns (a,b,c)
( partition p0 values less than (1, maxvalue, 10),
partition p1 values less than (1, maxvalue, maxvalue));
#
# BUG#48161, Delivering too few records using collate syntax with partitions
#
@ -78,7 +93,7 @@ subpartition by hash (to_seconds(d))
subpartitions 4
( partition p0 values less than (1, '0', MAXVALUE, '1900-01-01'),
partition p1 values less than (1, 'a', MAXVALUE, '1999-01-01'),
partition p2 values less than (1, 'a', MAXVALUE, MAXVALUE),
partition p2 values less than (1, 'b', MAXVALUE, MAXVALUE),
partition p3 values less than (1, MAXVALUE, MAXVALUE, MAXVALUE));
select partition_method, partition_expression, partition_description
from information_schema.partitions where table_name = "t1";

View File

@ -250,7 +250,6 @@ engine = innodb
partition by list (a)
(partition p0 values in (0));
-- error ER_MIX_HANDLER_ERROR
alter table t1 engine = x;
show create table t1;
drop table t1;

View File

@ -3767,9 +3767,14 @@ INSERT INTO t1 VALUES (2),(3);
--echo # Should not crash
--error ER_SUBQUERY_NO_1_ROW
SELECT 1 FROM t1 WHERE a <> 1 AND NOT
ROW(a,a) <=> ROW((SELECT 1 FROM t1 WHERE 1=2),(SELECT 1 FROM t1))
ROW(1,a) <=> ROW(1,(SELECT 1 FROM t1))
INTO @var0;
# Query correctly return 2 rows since comparison a <=> fisrt_subquery is
# always false, thus the second query is never executed.
SELECT 1 FROM t1 WHERE a <> 1 AND NOT
ROW(a,a) <=> ROW((SELECT 1 FROM t1 WHERE 1=2),(SELECT 1 FROM t1));
DROP TABLE t1;
@ -3918,4 +3923,38 @@ SELECT table1 .`time_key` field2 FROM B table1 LEFT JOIN BB JOIN A table5 ON
drop table A,AA,B,BB;
--echo #end of test for bug#45266
--echo #
--echo # Bug#33546: Slowdown on re-evaluation of constant expressions.
--echo #
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (2);
SELECT * FROM t1 WHERE a = 1 + 1;
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = 1 + 1;
SELECT * FROM t1 HAVING a = 1 + 1;
EXPLAIN EXTENDED SELECT * FROM t1 HAVING a = 1 + 1;
SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
EXPLAIN EXTENDED SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00');
delimiter |;
CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
BEGIN
SET @cnt := @cnt + 1;
RETURN 1;
END;|
delimiter ;|
SET @cnt := 0;
SELECT * FROM t1 WHERE a = f1();
SELECT @cnt;
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = f1();
DROP TABLE t1, t2;
DROP FUNCTION f1;
--echo # End of bug#33546
--echo End of 5.1 tests

View File

@ -2513,8 +2513,6 @@ DROP TABLE t1, t2;
CREATE TABLE t1 (i INT);
(SELECT i FROM t1) UNION (SELECT i FROM t1);
#TODO:not supported
--error ER_PARSE_ERROR
SELECT sql_no_cache * FROM t1 WHERE NOT EXISTS
(
(SELECT i FROM t1) UNION
@ -2531,8 +2529,6 @@ WHERE NOT EXISTS (((SELECT i FROM t1) UNION (SELECT i FROM t1)));
explain select ((select t11.i from t1 t11) union (select t12.i from t1 t12))
from t1;
#TODO:not supported
--error ER_PARSE_ERROR
explain select * from t1 where not exists
((select t11.i from t1 t11) union (select t12.i from t1 t12));
@ -3203,8 +3199,6 @@ EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
#TODO:not supported
--error ER_PARSE_ERROR
EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
(SELECT 1 FROM t2 WHERE t1.a = t2.a));
@ -3544,6 +3538,232 @@ where v in(select v
where t1.g=t2.g) is unknown;
drop table t1, t2;
-- echo #
-- echo # Bug#33204: INTO is allowed in subselect, causing inconsistent results
-- echo #
CREATE TABLE t1( a INT );
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2( a INT, b INT );
--error ER_PARSE_ERROR
SELECT *
FROM (SELECT a INTO @var FROM t1 WHERE a = 2) t1a;
--error ER_PARSE_ERROR
SELECT *
FROM (SELECT a INTO OUTFILE 'file' FROM t1 WHERE a = 2) t1a;
--error ER_PARSE_ERROR
SELECT *
FROM (SELECT a INTO DUMPFILE 'file' FROM t1 WHERE a = 2) t1a;
--error ER_PARSE_ERROR
SELECT * FROM (
SELECT 1 a
UNION
SELECT a INTO @var FROM t1 WHERE a = 2
) t1a;
--error ER_PARSE_ERROR
SELECT * FROM (
SELECT 1 a
UNION
SELECT a INTO OUTFILE 'file' FROM t1 WHERE a = 2
) t1a;
--error ER_PARSE_ERROR
SELECT * FROM (
SELECT 1 a
UNION
SELECT a INTO DUMPFILE 'file' FROM t1 WHERE a = 2
) t1a;
SELECT * FROM (SELECT a FROM t1 WHERE a = 2) t1a;
SELECT * FROM (
SELECT a FROM t1 WHERE a = 2
UNION
SELECT a FROM t1 WHERE a = 2
) t1a;
SELECT * FROM (
SELECT 1 a
UNION
SELECT a FROM t1 WHERE a = 2
UNION
SELECT a FROM t1 WHERE a = 2
) t1a;
# This was not allowed previously. Possibly, it should be allowed on the future.
# For now, the intent is to keep the fix as non-intrusive as possible.
--error ER_PARSE_ERROR
SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a);
SELECT * FROM (SELECT 1 a UNION (SELECT 1 a)) alias;
SELECT * FROM (SELECT 1 UNION SELECT 1) t1a;
--error ER_PARSE_ERROR
SELECT * FROM ((SELECT 1 a INTO @a)) t1a;
--error ER_PARSE_ERROR
SELECT * FROM ((SELECT 1 a INTO OUTFILE 'file' )) t1a;
--error ER_PARSE_ERROR
SELECT * FROM ((SELECT 1 a INTO DUMPFILE 'file' )) t1a;
--error ER_PARSE_ERROR
SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO @a)) t1a;
--error ER_PARSE_ERROR
SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO DUMPFILE 'file' )) t1a;
--error ER_PARSE_ERROR
SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO OUTFILE 'file' )) t1a;
--error ER_PARSE_ERROR
SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO @a))) t1a;
--error ER_PARSE_ERROR
SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO DUMPFILE 'file' ))) t1a;
--error ER_PARSE_ERROR
SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO OUTFILE 'file' ))) t1a;
SELECT * FROM (SELECT 1 a ORDER BY a) t1a;
SELECT * FROM (SELECT 1 a UNION SELECT 1 a ORDER BY a) t1a;
SELECT * FROM (SELECT 1 a UNION SELECT 1 a LIMIT 1) t1a;
SELECT * FROM (SELECT 1 a UNION SELECT 1 a ORDER BY a LIMIT 1) t1a;
# Test of rule
# table_factor: '(' get_select_lex query_expression_body ')' opt_table_alias
# UNION should not be allowed inside the parentheses, nor should
# aliases after.
#
SELECT * FROM t1 JOIN (SELECT 1 UNION SELECT 1) alias ON 1;
--error ER_PARSE_ERROR
SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 1;
--error ER_PARSE_ERROR
SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 1;
--error ER_PARSE_ERROR
SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 1;
--error ER_PARSE_ERROR
SELECT * FROM t1 JOIN (t1 t1a) t1a ON 1;
--error ER_PARSE_ERROR
SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 1;
SELECT * FROM t1 JOIN (t1 t1a) ON 1;
SELECT * FROM t1 JOIN ((t1 t1a)) ON 1;
SELECT * FROM (t1 t1a);
SELECT * FROM ((t1 t1a));
SELECT * FROM t1 JOIN (SELECT 1 t1a) alias ON 1;
SELECT * FROM t1 JOIN ((SELECT 1 t1a)) alias ON 1;
SELECT * FROM t1 JOIN (SELECT 1 a) a ON 1;
SELECT * FROM t1 JOIN ((SELECT 1 a)) a ON 1;
# For the join, TABLE_LIST::select_lex == NULL
# Check that we handle this.
--error ER_PARSE_ERROR
SELECT * FROM (t1 JOIN (SELECT 1) t1a1 ON 1) t1a2;
SELECT * FROM t1 WHERE a = ALL ( SELECT 1 );
SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION SELECT 1 );
SELECT * FROM t1 WHERE a = ANY ( SELECT 3 UNION SELECT 1 );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO @a);
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
SELECT * FROM t1 WHERE a = ( SELECT 1 );
SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a = ( SELECT 1 INTO @a);
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a = ( SELECT 1 INTO OUTFILE 'file' );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a = ( SELECT 1 INTO DUMPFILE 'file' );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO @a);
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
--error ER_PARSE_ERROR
SELECT ( SELECT 1 INTO @v );
--error ER_PARSE_ERROR
SELECT ( SELECT 1 INTO OUTFILE 'file' );
--error ER_PARSE_ERROR
SELECT ( SELECT 1 INTO DUMPFILE 'file' );
--error ER_PARSE_ERROR
SELECT ( SELECT 1 UNION SELECT 1 INTO @v );
--error ER_PARSE_ERROR
SELECT ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
--error ER_PARSE_ERROR
SELECT ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
# Make sure context is popped when we leave the nested select
SELECT ( SELECT a FROM t1 WHERE a = 1 ), a FROM t1;
SELECT ( SELECT a FROM t1 WHERE a = 1 UNION SELECT 1 ), a FROM t1;
# Make sure we have feature F561 (see .yy file)
SELECT * FROM t2 WHERE (a, b) IN (SELECT a, b FROM t2);
# Make sure the parser does not allow nested UNIONs anywhere
--error ER_PARSE_ERROR
SELECT 1 UNION ( SELECT 1 UNION SELECT 1 );
--error ER_PARSE_ERROR
( SELECT 1 UNION SELECT 1 ) UNION SELECT 1;
--error ER_PARSE_ERROR
SELECT ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
--error ER_PARSE_ERROR
SELECT ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1;
SELECT ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
SELECT ((SELECT 1 UNION SELECT 1 UNION SELECT 1));
--error ER_PARSE_ERROR
SELECT * FROM ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
--error ER_PARSE_ERROR
SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
SELECT * FROM ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ) a;
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a = ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION ( SELECT 1 UNION SELECT 1 ) );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a = ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a = ALL ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a = ANY ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a IN ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 1 );
SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE EXISTS ( SELECT 1 UNION SELECT 1 INTO @v );
SELECT EXISTS(SELECT 1+1);
--error ER_PARSE_ERROR
SELECT EXISTS(SELECT 1+1 INTO @test);
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION SELECT 1 INTO @v );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE EXISTS ( SELECT 1 INTO @v );
--error ER_PARSE_ERROR
SELECT * FROM t1 WHERE a IN ( SELECT 1 INTO @v );
DROP TABLE t1, t2;
#
# Bug #31157: Crash when select+order by the avg of some field within the
# group by

View File

@ -598,3 +598,23 @@ explain select convert(1, binary(4294967296));
explain select convert(1, binary(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
--echo End of 5.0 tests
#
# Bug #33969: Updating a text field via a left join
#
CREATE TABLE t1(id INT NOT NULL);
CREATE TABLE t2(id INT NOT NULL, c TEXT NOT NULL);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1, '');
UPDATE t2 SET c = REPEAT('1', 70000);
SELECT LENGTH(c) FROM t2;
UPDATE t1 LEFT JOIN t2 USING(id) SET t2.c = REPEAT('1', 70000) WHERE t1.id = 1;
SELECT LENGTH(c) FROM t2;
DROP TABLE t1, t2;
--echo End of 5.1 tests

View File

@ -449,3 +449,17 @@ SELECT IF( a = 1, a, a ) AS `b` FROM t1 ORDER BY field( `b`, 1 );
DROP TABLE t1;
--echo End of 5.0 tests.
--echo #
--echo # Bug#33546: Slowdown on re-evaluation of constant expressions.
--echo #
CREATE TABLE t1 (f1 INT);
INSERT INTO t1 VALUES(1),(50);
--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_double RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB";
EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE f1=1 + myfunc_double(1);
DROP FUNCTION myfunc_double;
DROP TABLE t1;
--echo #
--echo End of 5.1 tests.

View File

@ -91,88 +91,6 @@ SELECT @a:=1 UNION SELECT @a:=@a+1;
(SELECT 1) UNION (SELECT 2) ORDER BY (SELECT a);
(SELECT 1,3) UNION (SELECT 2,1) ORDER BY (SELECT 2);
#
# Bug#32858: Erro: "Incorrect usage of UNION and INTO" does not take subselects
# into account
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
SELECT a INTO @v FROM (
SELECT a FROM t1
UNION
SELECT a FROM t1
) alias;
--let $outfile = $MYSQLTEST_VARDIR/tmp/union.out.file
--error 0,1
--remove_file $outfile
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval SELECT a INTO OUTFILE '$outfile' FROM (
SELECT a FROM t1
UNION
SELECT a FROM t1 WHERE 0
) alias;
--remove_file $outfile
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval SELECT a INTO DUMPFILE '$outfile' FROM (
SELECT a FROM t1
UNION
SELECT a FROM t1 WHERE 0
) alias;
--remove_file $outfile
#
# INTO will not be allowed in subqueries in version 5.1 and above.
#
SELECT a FROM (
SELECT a FROM t1
UNION
SELECT a INTO @v FROM t1
) alias;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval SELECT a FROM (
SELECT a FROM t1
UNION
SELECT a INTO OUTFILE '$outfile' FROM t1
) alias;
--remove_file $outfile
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval SELECT a FROM (
SELECT a FROM t1
UNION
SELECT a INTO DUMPFILE '$outfile' FROM t1
) alias;
--remove_file $outfile
SELECT a FROM t1 UNION SELECT a INTO @v FROM t1;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval SELECT a FROM t1 UNION SELECT a INTO OUTFILE '$outfile' FROM t1;
--remove_file $outfile
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval SELECT a FROM t1 UNION SELECT a INTO DUMPFILE '$outfile' FROM t1;
--remove_file $outfile
--error ER_WRONG_USAGE
SELECT a INTO @v FROM t1 UNION SELECT a FROM t1;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
--error ER_WRONG_USAGE
eval SELECT a INTO OUTFILE '$outfile' FROM t1 UNION SELECT a FROM t1;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
--error ER_WRONG_USAGE
eval SELECT a INTO DUMPFILE '$outfile' FROM t1 UNION SELECT a FROM t1;
DROP TABLE t1;
#
# Test bug reported by joc@presence-pc.com
#
@ -1102,3 +1020,45 @@ DROP TABLE t1;
--echo End of 5.0 tests
-- echo #
-- echo # Bug#32858: Error: "Incorrect usage of UNION and INTO" does not take
-- echo # subselects into account
-- echo #
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
-- echo # Tests fix in parser rule select_derived_union.
SELECT a INTO @v FROM (
SELECT a FROM t1
UNION
SELECT a FROM t1
) alias;
SELECT a INTO OUTFILE 'union.out.file' FROM (
SELECT a FROM t1
UNION
SELECT a FROM t1 WHERE 0
) alias;
SELECT a INTO DUMPFILE 'union.out.file2' FROM (
SELECT a FROM t1
UNION
SELECT a FROM t1 WHERE 0
) alias;
SELECT a FROM t1 UNION SELECT a INTO @v FROM t1;
SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file5' FROM t1;
SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file6' FROM t1;
--error ER_WRONG_USAGE
SELECT a INTO @v FROM t1 UNION SELECT a FROM t1;
--error ER_WRONG_USAGE
SELECT a INTO OUTFILE 'union.out.file7' FROM t1 UNION SELECT a FROM t1;
--error ER_WRONG_USAGE
SELECT a INTO DUMPFILE 'union.out.file8' FROM t1 UNION SELECT a FROM t1;
-- echo # Tests fix in parser rule query_expression_body.
SELECT ( SELECT a UNION SELECT a ) INTO @v FROM t1;
SELECT ( SELECT a UNION SELECT a ) INTO OUTFILE 'union.out.file3' FROM t1;
SELECT ( SELECT a UNION SELECT a ) INTO DUMPFILE 'union.out.file4' FROM t1;
DROP TABLE t1;

View File

@ -255,6 +255,9 @@ static int add_collation(CHARSET_INFO *cs)
{
#if defined (HAVE_CHARSET_utf8) && defined(HAVE_UCA_COLLATIONS)
copy_uca_collation(newcs, &my_charset_utf8_unicode_ci);
newcs->ctype= my_charset_utf8_unicode_ci.ctype;
if (init_state_maps(newcs))
return MY_XML_ERROR;
#endif
}
else

View File

@ -29,7 +29,7 @@ SET(SEMISYNC_SLAVE_SOURCES semisync.cc semisync_slave.cc semisync_slave_plugin.c
ADD_DEFINITIONS(-DMYSQL_DYNAMIC_PLUGIN)
ADD_LIBRARY(semisync_master SHARED ${SEMISYNC_MASTER_SOURCES})
TARGET_LINK_LIBRARIES(semisync_master mysqld)
TARGET_LINK_LIBRARIES(semisync_master mysqlservices mysqld)
ADD_LIBRARY(semisync_slave SHARED ${SEMISYNC_SLAVE_SOURCES})
TARGET_LINK_LIBRARIES(semisync_slave mysqld)
MESSAGE("build SEMISYNC as DLL")

View File

@ -23,16 +23,16 @@ INCLUDES = -I$(top_srcdir)/include \
noinst_HEADERS = semisync.h semisync_master.h semisync_slave.h
pkgplugin_LTLIBRARIES = libsemisync_master.la libsemisync_slave.la
pkgplugin_LTLIBRARIES = semisync_master.la semisync_slave.la
libsemisync_master_la_LDFLAGS = -module
libsemisync_master_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libsemisync_master_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libsemisync_master_la_SOURCES = semisync.cc semisync_master.cc semisync_master_plugin.cc
semisync_master_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
semisync_master_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
semisync_master_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
semisync_master_la_SOURCES = semisync.cc semisync_master.cc semisync_master_plugin.cc
libsemisync_slave_la_LDFLAGS = -module
libsemisync_slave_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libsemisync_slave_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libsemisync_slave_la_SOURCES = semisync.cc semisync_slave.cc semisync_slave_plugin.cc
semisync_slave_la_LDFLAGS = -module -rpath $(pkgplugindir) -L$(top_builddir)/libservices -lmysqlservices
semisync_slave_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
semisync_slave_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
semisync_slave_la_SOURCES = semisync.cc semisync_slave.cc semisync_slave_plugin.cc
EXTRA_DIST= CMakeLists.txt plug.in

View File

@ -1,3 +1,3 @@
MYSQL_PLUGIN(semisync,[Semi-synchronous Replication Plugin],
[Semi-synchronous replication plugin.])
MYSQL_PLUGIN_DYNAMIC(semisync, [libsemisync_master.la libsemisync_slave.la])
MYSQL_PLUGIN_DYNAMIC(semisync, [semisync_master.la semisync_slave.la])

View File

@ -63,29 +63,14 @@ static int gettimeofday(struct timeval *tv, void *tz)
*
******************************************************************************/
ActiveTranx::ActiveTranx(int max_connections,
pthread_mutex_t *lock,
ActiveTranx::ActiveTranx(pthread_mutex_t *lock,
unsigned long trace_level)
: Trace(trace_level), num_transactions_(max_connections),
num_entries_(max_connections << 1),
: Trace(trace_level),
num_entries_(max_connections << 1), /* Transaction hash table size
* is set to double the size
* of max_connections */
lock_(lock)
{
/* Allocate the memory for the array */
node_array_ = new TranxNode[num_transactions_];
for (int idx = 0; idx < num_transactions_; ++idx)
{
node_array_[idx].log_pos_ = 0;
node_array_[idx].hash_next_ = NULL;
node_array_[idx].next_ = node_array_ + idx + 1;
node_array_[idx].log_name_ = new char[FN_REFLEN];
node_array_[idx].log_name_[0] = '\x0';
}
node_array_[num_transactions_-1].next_ = NULL;
/* All nodes in the array go to the pool initially. */
free_pool_ = node_array_;
/* No transactions are in the list initially. */
trx_front_ = NULL;
trx_rear_ = NULL;
@ -95,24 +80,13 @@ ActiveTranx::ActiveTranx(int max_connections,
for (int idx = 0; idx < num_entries_; ++idx)
trx_htb_[idx] = NULL;
sql_print_information("Semi-sync replication initialized for %d "
"transactions.", num_transactions_);
sql_print_information("Semi-sync replication initialized for transactions.");
}
ActiveTranx::~ActiveTranx()
{
for (int idx = 0; idx < num_transactions_; ++idx)
{
delete [] node_array_[idx].log_name_;
node_array_[idx].log_name_ = NULL;
}
delete [] node_array_;
delete [] trx_htb_;
node_array_ = NULL;
trx_htb_ = NULL;
num_transactions_ = 0;
num_entries_ = 0;
}
@ -143,26 +117,21 @@ unsigned int ActiveTranx::get_hash_value(const char *log_file_name,
ActiveTranx::TranxNode* ActiveTranx::alloc_tranx_node()
{
TranxNode *ptr = free_pool_;
if (free_pool_)
MYSQL_THD thd= (MYSQL_THD)current_thd;
/* The memory allocated for TranxNode will be automatically freed at
the end of the command of current THD. And because
ha_autocommit_or_rollback() will always be called before that, so
we are sure that the node will be removed from the active list
before it get freed. */
TranxNode *trx_node = (TranxNode *)thd_alloc(thd, sizeof(TranxNode));
if (trx_node)
{
free_pool_ = free_pool_->next_;
ptr->next_ = NULL;
ptr->hash_next_ = NULL;
trx_node->log_name_[0] = '\0';
trx_node->log_pos_= 0;
trx_node->next_= 0;
trx_node->hash_next_= 0;
}
else
{
/*
free_pool should never be NULL here, because we have
max_connections number of pre-allocated nodes.
*/
sql_print_error("You have encountered a semi-sync bug (free_pool == NULL), "
"please report to http://bugs.mysql.com");
assert(free_pool_);
}
return ptr;
return trx_node;
}
int ActiveTranx::compare(const char *log_file_name1, my_off_t log_file_pos1,
@ -306,14 +275,12 @@ int ActiveTranx::clear_active_tranx_nodes(const char *log_file_name,
/* Clear the active transaction list. */
if (trx_front_ != NULL)
{
trx_rear_->next_ = free_pool_;
free_pool_ = trx_front_;
trx_front_ = NULL;
trx_rear_ = NULL;
}
if (trace_level_ & kTraceDetail)
sql_print_information("%s: free all nodes back to free list", kWho);
sql_print_information("%s: cleared all nodes", kWho);
}
else if (new_front != trx_front_)
{
@ -325,10 +292,6 @@ int ActiveTranx::clear_active_tranx_nodes(const char *log_file_name,
while (curr_node != new_front)
{
next_node = curr_node->next_;
/* Put the node in the memory pool. */
curr_node->next_ = free_pool_;
free_pool_ = curr_node;
n_frees++;
/* Remove the node from the hash table. */
@ -350,7 +313,7 @@ int ActiveTranx::clear_active_tranx_nodes(const char *log_file_name,
trx_front_ = new_front;
if (trace_level_ & kTraceDetail)
sql_print_information("%s: free %d nodes back until pos (%s, %lu)",
sql_print_information("%s: cleared %d nodes back until pos (%s, %lu)",
kWho, n_frees,
trx_front_->log_name_, (unsigned long)trx_front_->log_pos_);
}
@ -391,8 +354,7 @@ ReplSemiSyncMaster::ReplSemiSyncMaster()
wait_file_pos_(0),
master_enabled_(false),
wait_timeout_(0L),
state_(0),
max_transactions_(0L)
state_(0)
{
strcpy(reply_file_name_, "");
strcpy(wait_file_name_, "");
@ -413,7 +375,6 @@ int ReplSemiSyncMaster::initObject()
/* References to the parameter works after set_options(). */
setWaitTimeout(rpl_semi_sync_master_timeout);
setTraceLevel(rpl_semi_sync_master_trace_level);
max_transactions_ = (int)max_connections;
/* Mutex initialization can only be done after MY_INIT(). */
pthread_mutex_init(&LOCK_binlog_, MY_MUTEX_INIT_FAST);
@ -436,9 +397,7 @@ int ReplSemiSyncMaster::enableMaster()
if (!getMasterEnabled())
{
active_tranxs_ = new ActiveTranx(max_connections,
&LOCK_binlog_,
trace_level_);
active_tranxs_ = new ActiveTranx(&LOCK_binlog_, trace_level_);
if (active_tranxs_ != NULL)
{
commit_file_name_inited_ = false;

View File

@ -23,31 +23,26 @@
/**
This class manages memory for active transaction list.
We record each active transaction with a TranxNode. Because each
session can only have only one open transaction, the total active
transaction nodes can not exceed the maximum sessions. Currently
in MySQL, sessions are the same as connections.
We record each active transaction with a TranxNode, each session
can have only one open transaction. Because of EVENT, the total
active transaction nodes can exceed the maximum allowed
connections.
*/
class ActiveTranx
:public Trace {
private:
struct TranxNode {
char *log_name_;
char log_name_[FN_REFLEN];
my_off_t log_pos_;
struct TranxNode *next_; /* the next node in the sorted list */
struct TranxNode *hash_next_; /* the next node during hash collision */
};
/* The following data structure maintains an active transaction list. */
TranxNode *node_array_;
TranxNode *free_pool_;
/* These two record the active transaction list in sort order. */
TranxNode *trx_front_, *trx_rear_;
TranxNode **trx_htb_; /* A hash table on active transactions. */
int num_transactions_; /* maximum transactions */
int num_entries_; /* maximum hash table entries */
pthread_mutex_t *lock_; /* mutex lock */
@ -74,8 +69,7 @@ private:
}
public:
ActiveTranx(int max_connections, pthread_mutex_t *lock,
unsigned long trace_level);
ActiveTranx(pthread_mutex_t *lock, unsigned long trace_level);
~ActiveTranx();
/* Insert an active transaction node with the specified position.
@ -177,11 +171,6 @@ class ReplSemiSyncMaster
bool state_; /* whether semi-sync is switched */
/* The number of maximum active transactions. This should be the same as
* maximum connections because MySQL does not do connection sharing now.
*/
int max_transactions_;
void lock();
void unlock();
void cond_broadcast();

View File

@ -358,9 +358,15 @@ do
mkdir -p $dir
chmod 700 $dir
fi
if test -w / -a ! -z "$user"
if test -n "$user"
then
chown $user $dir
if test $? -ne 0
then
echo "Cannot change ownership of the database directories to the '$user'"
echo "user. Check that you have the necessary permissions and try again."
exit 1
fi
fi
done

View File

@ -128,7 +128,6 @@ post_init_event_thread(THD *thd)
thd->cleanup();
return TRUE;
}
lex_start(thd);
pthread_mutex_lock(&LOCK_thread_count);
threads.append(thd);

View File

@ -895,7 +895,6 @@ Events::init(my_bool opt_noacl_or_bootstrap)
*/
thd->thread_stack= (char*) &thd;
thd->store_globals();
lex_start(thd);
/*
We will need Event_db_repository anyway, even if the scheduler is

View File

@ -6956,7 +6956,6 @@ int ndb_create_table_from_engine(THD *thd, const char *db,
LEX *old_lex= thd->lex, newlex;
thd->lex= &newlex;
newlex.current_select= NULL;
lex_start(thd);
int res= ha_create_table_from_engine(thd, db, table_name);
thd->lex= old_lex;
return res;
@ -9317,7 +9316,6 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
thd->thread_stack= (char*)&thd; /* remember where our stack is */
if (thd->store_globals())
goto ndb_util_thread_fail;
lex_start(thd);
thd->init_for_queries();
thd->version=refresh_version;
thd->main_security_ctx.host_or_ip= "";

View File

@ -3654,7 +3654,6 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
pthread_exit(0);
return NULL; // Avoid compiler warnings
}
lex_start(thd);
thd->init_for_queries();
thd->command= COM_DAEMON;

View File

@ -5025,7 +5025,7 @@ Field *Item::make_string_field(TABLE *table)
DBUG_ASSERT(collation.collation);
if (max_length/collation.collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB)
field= new Field_blob(max_length, maybe_null, name,
collation.collation);
collation.collation, TRUE);
/* Item_type_holder holds the exact type, do not change it */
else if (max_length > 0 &&
(type() != Item::TYPE_HOLDER || field_type() != MYSQL_TYPE_STRING))
@ -5766,6 +5766,67 @@ bool Item::send(Protocol *protocol, String *buffer)
}
/**
Check if an item is a constant one and can be cached.
@param arg [out] TRUE <=> Cache this item.
@return TRUE Go deeper in item tree.
@return FALSE Don't go deeper in item tree.
*/
bool Item::cache_const_expr_analyzer(uchar **arg)
{
bool *cache_flag= (bool*)*arg;
if (!*cache_flag)
{
Item *item= real_item();
/*
Cache constant items unless it's a basic constant, constant field or
a subselect (they use their own cache).
*/
if (const_item() &&
!(item->basic_const_item() || item->type() == Item::FIELD_ITEM ||
item->type() == SUBSELECT_ITEM ||
/*
Do not cache GET_USER_VAR() function as its const_item() may
return TRUE for the current thread but it still may change
during the execution.
*/
(item->type() == Item::FUNC_ITEM &&
((Item_func*)item)->functype() == Item_func::GUSERVAR_FUNC)))
*cache_flag= TRUE;
return TRUE;
}
return FALSE;
}
/**
Cache item if needed.
@param arg TRUE <=> Cache this item.
@return cache if cache needed.
@return this otherwise.
*/
Item* Item::cache_const_expr_transformer(uchar *arg)
{
if (*(bool*)arg)
{
*((bool*)arg)= FALSE;
Item_cache *cache= Item_cache::get_cache(this);
if (!cache)
return NULL;
cache->setup(this);
cache->store(this);
return cache;
}
return this;
}
bool Item_field::send(Protocol *protocol, String *buffer)
{
return protocol->store(result_field);
@ -7104,7 +7165,22 @@ int stored_field_cmp_to_item(THD *thd, Field *field, Item *item)
Item_cache* Item_cache::get_cache(const Item *item)
{
switch (item->result_type()) {
return get_cache(item, item->result_type());
}
/**
Get a cache item of given type.
@param item value to be cached
@param type required type of cache
@return cache item
*/
Item_cache* Item_cache::get_cache(const Item *item, const Item_result type)
{
switch (type) {
case INT_RESULT:
return new Item_cache_int();
case REAL_RESULT:
@ -7112,6 +7188,10 @@ Item_cache* Item_cache::get_cache(const Item *item)
case DECIMAL_RESULT:
return new Item_cache_decimal();
case STRING_RESULT:
if (item->field_type() == MYSQL_TYPE_DATE ||
item->field_type() == MYSQL_TYPE_DATETIME ||
item->field_type() == MYSQL_TYPE_TIME)
return new Item_cache_datetime(item->field_type());
return new Item_cache_str(item);
case ROW_RESULT:
return new Item_cache_row();
@ -7122,6 +7202,12 @@ Item_cache* Item_cache::get_cache(const Item *item)
}
}
void Item_cache::store(Item *item)
{
if (item)
example= item;
value_cached= FALSE;
}
void Item_cache::print(String *str, enum_query_type query_type)
{
@ -7133,17 +7219,19 @@ void Item_cache::print(String *str, enum_query_type query_type)
str->append(')');
}
void Item_cache_int::store(Item *item)
void Item_cache_int::cache_value()
{
value= item->val_int_result();
null_value= item->null_value;
unsigned_flag= item->unsigned_flag;
value_cached= TRUE;
value= example->val_int_result();
null_value= example->null_value;
unsigned_flag= example->unsigned_flag;
}
void Item_cache_int::store(Item *item, longlong val_arg)
{
/* An explicit values is given, save it. */
value_cached= TRUE;
value= val_arg;
null_value= item->null_value;
unsigned_flag= item->unsigned_flag;
@ -7153,6 +7241,8 @@ void Item_cache_int::store(Item *item, longlong val_arg)
String *Item_cache_int::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
if (!value_cached)
cache_value();
str->set(value, default_charset());
return str;
}
@ -7161,21 +7251,115 @@ String *Item_cache_int::val_str(String *str)
my_decimal *Item_cache_int::val_decimal(my_decimal *decimal_val)
{
DBUG_ASSERT(fixed == 1);
if (!value_cached)
cache_value();
int2my_decimal(E_DEC_FATAL_ERROR, value, unsigned_flag, decimal_val);
return decimal_val;
}
void Item_cache_real::store(Item *item)
double Item_cache_int::val_real()
{
value= item->val_result();
null_value= item->null_value;
DBUG_ASSERT(fixed == 1);
if (!value_cached)
cache_value();
return (double) value;
}
longlong Item_cache_int::val_int()
{
DBUG_ASSERT(fixed == 1);
if (!value_cached)
cache_value();
return value;
}
void Item_cache_datetime::cache_value_int()
{
value_cached= TRUE;
/* Assume here that the underlying item will do correct conversion.*/
int_value= example->val_int_result();
null_value= example->null_value;
unsigned_flag= example->unsigned_flag;
}
void Item_cache_datetime::cache_value()
{
str_value_cached= TRUE;
/* Assume here that the underlying item will do correct conversion.*/
String *res= example->str_result(&str_value);
if (res && res != &str_value)
str_value.copy(*res);
null_value= example->null_value;
unsigned_flag= example->unsigned_flag;
}
void Item_cache_datetime::store(Item *item, longlong val_arg)
{
/* An explicit values is given, save it. */
value_cached= TRUE;
int_value= val_arg;
null_value= item->null_value;
unsigned_flag= item->unsigned_flag;
}
String *Item_cache_datetime::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
if (!str_value_cached)
cache_value();
return &str_value;
}
my_decimal *Item_cache_datetime::val_decimal(my_decimal *decimal_val)
{
DBUG_ASSERT(fixed == 1);
if (!value_cached)
cache_value_int();
int2my_decimal(E_DEC_FATAL_ERROR, int_value, unsigned_flag, decimal_val);
return decimal_val;
}
double Item_cache_datetime::val_real()
{
DBUG_ASSERT(fixed == 1);
if (!value_cached)
cache_value_int();
return (double) int_value;
}
longlong Item_cache_datetime::val_int()
{
DBUG_ASSERT(fixed == 1);
if (!value_cached)
cache_value_int();
return int_value;
}
void Item_cache_real::cache_value()
{
value_cached= TRUE;
value= example->val_result();
null_value= example->null_value;
}
double Item_cache_real::val_real()
{
DBUG_ASSERT(fixed == 1);
if (!value_cached)
cache_value();
return value;
}
longlong Item_cache_real::val_int()
{
DBUG_ASSERT(fixed == 1);
if (!value_cached)
cache_value();
return (longlong) rint(value);
}
@ -7183,6 +7367,8 @@ longlong Item_cache_real::val_int()
String* Item_cache_real::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
if (!value_cached)
cache_value();
str->set_real(value, decimals, default_charset());
return str;
}
@ -7191,15 +7377,18 @@ String* Item_cache_real::val_str(String *str)
my_decimal *Item_cache_real::val_decimal(my_decimal *decimal_val)
{
DBUG_ASSERT(fixed == 1);
if (!value_cached)
cache_value();
double2my_decimal(E_DEC_FATAL_ERROR, value, decimal_val);
return decimal_val;
}
void Item_cache_decimal::store(Item *item)
void Item_cache_decimal::cache_value()
{
my_decimal *val= item->val_decimal_result(&decimal_value);
if (!(null_value= item->null_value) && val != &decimal_value)
value_cached= TRUE;
my_decimal *val= example->val_decimal_result(&decimal_value);
if (!(null_value= example->null_value) && val != &decimal_value)
my_decimal2decimal(val, &decimal_value);
}
@ -7207,6 +7396,8 @@ double Item_cache_decimal::val_real()
{
DBUG_ASSERT(fixed);
double res;
if (!value_cached)
cache_value();
my_decimal2double(E_DEC_FATAL_ERROR, &decimal_value, &res);
return res;
}
@ -7215,6 +7406,8 @@ longlong Item_cache_decimal::val_int()
{
DBUG_ASSERT(fixed);
longlong res;
if (!value_cached)
cache_value();
my_decimal2int(E_DEC_FATAL_ERROR, &decimal_value, unsigned_flag, &res);
return res;
}
@ -7222,6 +7415,8 @@ longlong Item_cache_decimal::val_int()
String* Item_cache_decimal::val_str(String *str)
{
DBUG_ASSERT(fixed);
if (!value_cached)
cache_value();
my_decimal_round(E_DEC_FATAL_ERROR, &decimal_value, decimals, FALSE,
&decimal_value);
my_decimal2string(E_DEC_FATAL_ERROR, &decimal_value, 0, 0, 0, str);
@ -7231,15 +7426,18 @@ String* Item_cache_decimal::val_str(String *str)
my_decimal *Item_cache_decimal::val_decimal(my_decimal *val)
{
DBUG_ASSERT(fixed);
if (!value_cached)
cache_value();
return &decimal_value;
}
void Item_cache_str::store(Item *item)
void Item_cache_str::cache_value()
{
value_buff.set(buffer, sizeof(buffer), item->collation.collation);
value= item->str_result(&value_buff);
if ((null_value= item->null_value))
value_cached= TRUE;
value_buff.set(buffer, sizeof(buffer), example->collation.collation);
value= example->str_result(&value_buff);
if ((null_value= example->null_value))
value= 0;
else if (value != &value_buff)
{
@ -7261,6 +7459,8 @@ double Item_cache_str::val_real()
DBUG_ASSERT(fixed == 1);
int err_not_used;
char *end_not_used;
if (!value_cached)
cache_value();
if (value)
return my_strntod(value->charset(), (char*) value->ptr(),
value->length(), &end_not_used, &err_not_used);
@ -7272,6 +7472,8 @@ longlong Item_cache_str::val_int()
{
DBUG_ASSERT(fixed == 1);
int err;
if (!value_cached)
cache_value();
if (value)
return my_strntoll(value->charset(), value->ptr(),
value->length(), 10, (char**) 0, &err);
@ -7279,9 +7481,21 @@ longlong Item_cache_str::val_int()
return (longlong)0;
}
String* Item_cache_str::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
if (!value_cached)
cache_value();
return value;
}
my_decimal *Item_cache_str::val_decimal(my_decimal *decimal_val)
{
DBUG_ASSERT(fixed == 1);
if (!value_cached)
cache_value();
if (value)
string2my_decimal(E_DEC_FATAL_ERROR, value, decimal_val);
else
@ -7292,6 +7506,8 @@ my_decimal *Item_cache_str::val_decimal(my_decimal *decimal_val)
int Item_cache_str::save_in_field(Field *field, bool no_conversions)
{
if (!value_cached)
cache_value();
int res= Item_cache::save_in_field(field, no_conversions);
return (is_varbinary && field->type() == MYSQL_TYPE_STRING &&
value->length() < field->field_length) ? 1 : res;
@ -7326,11 +7542,19 @@ bool Item_cache_row::setup(Item * item)
void Item_cache_row::store(Item * item)
{
for (uint i= 0; i < item_count; i++)
values[i]->store(item->element_index(i));
}
void Item_cache_row::cache_value()
{
value_cached= TRUE;
null_value= 0;
item->bring_value();
example->bring_value();
for (uint i= 0; i < item_count; i++)
{
values[i]->store(item->element_index(i));
values[i]->cache_value();
null_value|= values[i]->null_value;
}
}

View File

@ -903,6 +903,9 @@ public:
virtual bool reset_query_id_processor(uchar *query_id_arg) { return 0; }
virtual bool is_expensive_processor(uchar *arg) { return 0; }
virtual bool register_field_in_read_map(uchar *arg) { return 0; }
virtual bool cache_const_expr_analyzer(uchar **arg);
virtual Item* cache_const_expr_transformer(uchar *arg);
/*
Check if a partition function is allowed
SYNOPSIS
@ -1032,7 +1035,11 @@ class sp_head;
class Item_basic_constant :public Item
{
table_map used_table_map;
public:
Item_basic_constant(): Item(), used_table_map(0) {};
void set_used_tables(table_map map) { used_table_map= map; }
table_map used_tables() const { return used_table_map; }
/* to prevent drop fixed flag (no need parent cleanup call) */
void cleanup()
{
@ -2288,6 +2295,7 @@ public:
if (ref && result_type() == ROW_RESULT)
(*ref)->bring_value();
}
bool basic_const_item() { return (*ref)->basic_const_item(); }
};
@ -2918,15 +2926,25 @@ protected:
*/
Field *cached_field;
enum enum_field_types cached_field_type;
/*
TRUE <=> cache holds value of the last stored item (i.e actual value).
store() stores item to be cached and sets this flag to FALSE.
On the first call of val_xxx function if this flag is set to FALSE the
cache_value() will be called to actually cache value of saved item.
cache_value() will set this flag to TRUE.
*/
bool value_cached;
public:
Item_cache():
example(0), used_table_map(0), cached_field(0), cached_field_type(MYSQL_TYPE_STRING)
Item_cache():
example(0), used_table_map(0), cached_field(0), cached_field_type(MYSQL_TYPE_STRING),
value_cached(0)
{
fixed= 1;
null_value= 1;
}
Item_cache(enum_field_types field_type_arg):
example(0), used_table_map(0), cached_field(0), cached_field_type(field_type_arg)
example(0), used_table_map(0), cached_field(0), cached_field_type(field_type_arg),
value_cached(0)
{
fixed= 1;
null_value= 1;
@ -2946,10 +2964,10 @@ public:
cached_field= ((Item_field *)item)->field;
return 0;
};
virtual void store(Item *)= 0;
enum Type type() const { return CACHE_ITEM; }
enum_field_types field_type() const { return cached_field_type; }
static Item_cache* get_cache(const Item *item);
static Item_cache* get_cache(const Item* item, const Item_result type);
table_map used_tables() const { return used_table_map; }
virtual void keep_array() {}
virtual void print(String *str, enum_query_type query_type);
@ -2961,6 +2979,10 @@ public:
{
return this == item;
}
virtual void store(Item *item);
virtual void cache_value()= 0;
bool basic_const_item() const
{ return test(example && example->basic_const_item());}
};
@ -2969,18 +2991,19 @@ class Item_cache_int: public Item_cache
protected:
longlong value;
public:
Item_cache_int(): Item_cache(), value(0) {}
Item_cache_int(): Item_cache(),
value(0) {}
Item_cache_int(enum_field_types field_type_arg):
Item_cache(field_type_arg), value(0) {}
void store(Item *item);
void store(Item *item, longlong val_arg);
double val_real() { DBUG_ASSERT(fixed == 1); return (double) value; }
longlong val_int() { DBUG_ASSERT(fixed == 1); return value; }
double val_real();
longlong val_int();
String* val_str(String *str);
my_decimal *val_decimal(my_decimal *);
enum Item_result result_type() const { return INT_RESULT; }
bool result_as_longlong() { return TRUE; }
void cache_value();
};
@ -2988,14 +3011,15 @@ class Item_cache_real: public Item_cache
{
double value;
public:
Item_cache_real(): Item_cache(), value(0) {}
Item_cache_real(): Item_cache(),
value(0) {}
void store(Item *item);
double val_real() { DBUG_ASSERT(fixed == 1); return value; }
double val_real();
longlong val_int();
String* val_str(String *str);
my_decimal *val_decimal(my_decimal *);
enum Item_result result_type() const { return REAL_RESULT; }
void cache_value();
};
@ -3006,12 +3030,12 @@ protected:
public:
Item_cache_decimal(): Item_cache() {}
void store(Item *item);
double val_real();
longlong val_int();
String* val_str(String *str);
my_decimal *val_decimal(my_decimal *);
enum Item_result result_type() const { return DECIMAL_RESULT; }
void cache_value();
};
@ -3029,14 +3053,14 @@ public:
MYSQL_TYPE_VARCHAR &&
!((const Item_field *) item)->field->has_charset())
{}
void store(Item *item);
double val_real();
longlong val_int();
String* val_str(String *) { DBUG_ASSERT(fixed == 1); return value; }
String* val_str(String *);
my_decimal *val_decimal(my_decimal *);
enum Item_result result_type() const { return STRING_RESULT; }
CHARSET_INFO *charset() const { return value->charset(); };
int save_in_field(Field *field, bool no_conversions);
void cache_value();
};
class Item_cache_row: public Item_cache
@ -3046,7 +3070,8 @@ class Item_cache_row: public Item_cache
bool save_array;
public:
Item_cache_row()
:Item_cache(), values(0), item_count(2), save_array(0) {}
:Item_cache(), values(0), item_count(2),
save_array(0) {}
/*
'allocate' used only in row transformer, to preallocate space for row
@ -3104,6 +3129,39 @@ public:
values= 0;
DBUG_VOID_RETURN;
}
void cache_value();
};
class Item_cache_datetime: public Item_cache
{
protected:
String str_value;
ulonglong int_value;
bool str_value_cached;
public:
Item_cache_datetime(enum_field_types field_type_arg):
Item_cache(field_type_arg), int_value(0), str_value_cached(0)
{
cmp_context= STRING_RESULT;
}
void store(Item *item, longlong val_arg);
double val_real();
longlong val_int();
String* val_str(String *str);
my_decimal *val_decimal(my_decimal *);
enum Item_result result_type() const { return STRING_RESULT; }
bool result_as_longlong() { return TRUE; }
/*
In order to avoid INT <-> STRING conversion of a DATETIME value
two cache_value functions are introduced. One (cache_value) caches STRING
value, another (cache_value_int) - INT value. Thus this cache item
completely relies on the ability of the underlying item to do the
correct conversion.
*/
void cache_value_int();
void cache_value();
};

View File

@ -882,13 +882,13 @@ int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg,
{
enum enum_date_cmp_type cmp_type;
ulonglong const_value= (ulonglong)-1;
thd= current_thd;
owner= owner_arg;
a= a1;
b= a2;
if ((cmp_type= can_compare_as_dates(*a, *b, &const_value)))
{
thd= current_thd;
owner= owner_arg;
a_type= (*a)->field_type();
b_type= (*b)->field_type();
a_cache= 0;
@ -896,6 +896,10 @@ int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg,
if (const_value != (ulonglong)-1)
{
/*
cache_converted_constant can't be used here because it can't
correctly convert a DATETIME value from string to int representation.
*/
Item_cache_int *cache= new Item_cache_int();
/* Mark the cache as non-const to prevent re-caching. */
cache->set_used_tables(1);
@ -921,8 +925,6 @@ int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg,
(*b)->field_type() == MYSQL_TYPE_TIME)
{
/* Compare TIME values as integers. */
thd= current_thd;
owner= owner_arg;
a_cache= 0;
b_cache= 0;
is_nulls_eq= test(owner && owner->functype() == Item_func::EQUAL_FUNC);
@ -941,10 +943,46 @@ int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg,
return 1;
}
a= cache_converted_constant(thd, a, &a_cache, type);
b= cache_converted_constant(thd, b, &b_cache, type);
return set_compare_func(owner_arg, type);
}
/**
Convert and cache a constant.
@param value [in] An item to cache
@param cache_item [out] Placeholder for the cache item
@param type [in] Comparison type
@details
When given item is a constant and its type differs from comparison type
then cache its value to avoid type conversion of this constant on each
evaluation. In this case the value is cached and the reference to the cache
is returned.
Original value is returned otherwise.
@return cache item or original value.
*/
Item** Arg_comparator::cache_converted_constant(THD *thd, Item **value,
Item **cache_item,
Item_result type)
{
/* Don't need cache if doing context analysis only. */
if (!thd->is_context_analysis_only() &&
(*value)->const_item() && type != (*value)->result_type())
{
Item_cache *cache= Item_cache::get_cache(*value, type);
cache->store(*value);
*cache_item= cache;
return cache_item;
}
return value;
}
void Arg_comparator::set_datetime_cmp_func(Item **a1, Item **b1)
{
thd= current_thd;
@ -1583,6 +1621,7 @@ longlong Item_in_optimizer::val_int()
bool tmp;
DBUG_ASSERT(fixed == 1);
cache->store(args[0]);
cache->cache_value();
if (cache->null_value)
{

View File

@ -97,6 +97,8 @@ public:
ulonglong *const_val_arg);
void set_datetime_cmp_func(Item **a1, Item **b1);
Item** cache_converted_constant(THD *thd, Item **value, Item **cache,
Item_result type);
static arg_cmp_func comparator_matrix [5][2];
friend class Item_func;

View File

@ -3127,7 +3127,7 @@ String *udf_handler::val_str(String *str,String *save_str)
if (res == str->ptr())
{
str->length(res_length);
DBUG_PRINT("exit", ("str: %s", str->ptr()));
DBUG_PRINT("exit", ("str: %*.s", (int) str->length(), str->ptr()));
DBUG_RETURN(str);
}
save_str->set(res, res_length, str->charset());

View File

@ -480,6 +480,7 @@ Item_singlerow_subselect::select_transformer(JOIN *join)
void Item_singlerow_subselect::store(uint i, Item *item)
{
row[i]->store(item);
row[i]->cache_value();
}
enum Item_result Item_singlerow_subselect::result_type() const
@ -1826,6 +1827,7 @@ void subselect_engine::set_row(List<Item> &item_list, Item_cache **row)
if (!(row[i]= Item_cache::get_cache(sel_item)))
return;
row[i]->setup(sel_item);
row[i]->store(sel_item);
}
if (item_list.elements > 1)
res_type= ROW_RESULT;

View File

@ -941,14 +941,16 @@ static Item *create_comparator(MY_XPATH *xpath,
in a loop through all of the nodes in the node set.
*/
Item *fake= new Item_string("", 0, xpath->cs);
Item_string *fake= new Item_string("", 0, xpath->cs);
/* Don't cache fake because its value will be changed during comparison.*/
fake->set_used_tables(RAND_TABLE_BIT);
Item_nodeset_func *nodeset;
Item *scalar, *comp;
if (a->type() == Item::XPATH_NODESET)
{
nodeset= (Item_nodeset_func*) a;
scalar= b;
comp= eq_func(oper, fake, scalar);
comp= eq_func(oper, (Item*)fake, scalar);
}
else
{

View File

@ -801,7 +801,7 @@ int partition_info::compare_column_values(const void *first_arg,
if (first->max_value || second->max_value)
{
if (first->max_value && second->max_value)
continue;
return 0;
if (second->max_value)
return -1;
else

View File

@ -413,8 +413,8 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
thd->variables.character_set_results,
err, strlen(err),
system_charset_info, &error);
length= (uint) (strmake((char*) pos, (char*)converted_err, MYSQL_ERRMSG_SIZE) -
(char*) buff);
length= (uint) (strmake((char*) pos, (char*)converted_err,
MYSQL_ERRMSG_SIZE - 1) - (char*) buff);
err= (char*) buff;
DBUG_RETURN(net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) err,
@ -1012,8 +1012,8 @@ bool Protocol_text::store(const char *from, size_t length,
{
CHARSET_INFO *tocs= this->thd->variables.character_set_results;
#ifndef DBUG_OFF
DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %s", field_pos,
field_count, from));
DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %*.s",
field_pos, field_count, (int) length, from));
DBUG_ASSERT(field_pos < field_count);
DBUG_ASSERT(field_types == 0 ||
field_types[field_pos] == MYSQL_TYPE_DECIMAL ||

View File

@ -137,28 +137,53 @@ void delegates_destroy()
*/
#define FOREACH_OBSERVER(r, f, thd, args) \
param.server_id= thd->server_id; \
/*
Use a struct to make sure that they are allocated adjacent, check
delete_dynamic().
*/ \
struct { \
DYNAMIC_ARRAY plugins; \
/* preallocate 8 slots */ \
plugin_ref plugins_buffer[8]; \
} s; \
DYNAMIC_ARRAY *plugins= &s.plugins; \
plugin_ref *plugins_buffer= s.plugins_buffer; \
my_init_dynamic_array2(plugins, sizeof(plugin_ref), \
plugins_buffer, 8, 8); \
read_lock(); \
Observer_info_iterator iter= observer_info_iter(); \
Observer_info *info= iter++; \
for (; info; info= iter++) \
{ \
plugin_ref plugin= \
my_plugin_lock(thd, &info->plugin); \
my_plugin_lock(0, &info->plugin); \
if (!plugin) \
{ \
r= 1; \
/* plugin is not intialized or deleted, this is not an error */ \
r= 0; \
break; \
} \
insert_dynamic(plugins, (uchar *)&plugin); \
if (((Observer *)info->observer)->f \
&& ((Observer *)info->observer)->f args) \
{ \
r= 1; \
plugin_unlock(thd, plugin); \
sql_print_error("Run function '" #f "' in plugin '%s' failed", \
info->plugin_int->name.str); \
break; \
} \
plugin_unlock(thd, plugin); \
} \
unlock()
unlock(); \
/*
Unlock plugins should be done after we released the Delegate lock
to avoid possible deadlock when this is the last user of the
plugin, and when we unlock the plugin, it will try to
deinitialize the plugin, which will try to lock the Delegate in
order to remove the observers.
*/ \
plugin_unlock_list(0, (plugin_ref*)plugins->buffer, \
plugins->elements); \
delete_dynamic(plugins)
int Trans_delegate::after_commit(THD *thd, bool all)

View File

@ -1933,7 +1933,6 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
thd->cleanup();
DBUG_RETURN(-1);
}
lex_start(thd);
if (thd_type == SLAVE_THD_SQL)
thd_proc_info(thd, "Waiting for the next event in relay log");

View File

@ -3997,7 +3997,7 @@ sp_head::add_used_tables_to_table_list(THD *thd,
/**
Simple function for adding an explicetly named (systems) table to
Simple function for adding an explicitly named (systems) table to
the global table list, e.g. "mysql", "proc".
*/

View File

@ -669,7 +669,7 @@ sp_rcontext::set_case_expr(THD *thd, int case_expr_id, Item **case_expr_item_ptr
}
m_case_expr_holders[case_expr_id]->store(case_expr_item);
m_case_expr_holders[case_expr_id]->cache_value();
return FALSE;
}

View File

@ -277,7 +277,6 @@ my_bool acl_init(bool dont_read_acl_tables)
DBUG_RETURN(1); /* purecov: inspected */
thd->thread_stack= (char*) &thd;
thd->store_globals();
lex_start(thd);
/*
It is safe to call acl_reload() since acl_* arrays and hashes which
will be freed there are global static objects and thus are initialized
@ -3582,7 +3581,6 @@ my_bool grant_init()
DBUG_RETURN(1); /* purecov: deadcode */
thd->thread_stack= (char*) &thd;
thd->store_globals();
lex_start(thd);
return_val= grant_reload(thd);
delete thd;
/* Remember that we don't have a THD */
@ -3804,11 +3802,11 @@ static my_bool grant_reload_procs_priv(THD *thd)
DBUG_RETURN(TRUE);
}
rw_wrlock(&LOCK_grant);
/* Save a copy of the current hash if we need to undo the grant load */
old_proc_priv_hash= proc_priv_hash;
old_func_priv_hash= func_priv_hash;
rw_wrlock(&LOCK_grant);
if ((return_val= grant_load_procs_priv(table.table)))
{
/* Error; Reverting to old hash */

View File

@ -7748,7 +7748,6 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
COND **conds)
{
SELECT_LEX *select_lex= thd->lex->current_select;
Query_arena *arena= thd->stmt_arena, backup;
TABLE_LIST *table= NULL; // For HP compilers
/*
it_is_update set to TRUE when tables of primary SELECT_LEX (SELECT_LEX
@ -7764,10 +7763,6 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
select_lex->is_item_list_lookup= 0;
DBUG_ENTER("setup_conds");
if (select_lex->conds_processed_with_permanent_arena ||
arena->is_conventional())
arena= 0; // For easier test
thd->mark_used_columns= MARK_COLUMNS_READ;
DBUG_PRINT("info", ("thd->mark_used_columns: %d", thd->mark_used_columns));
select_lex->cond_count= 0;
@ -7836,7 +7831,6 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
We do this ON -> WHERE transformation only once per PS/SP statement.
*/
select_lex->where= *conds;
select_lex->conds_processed_with_permanent_arena= 1;
}
thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup;
DBUG_RETURN(test(thd->is_error()));

View File

@ -1616,7 +1616,6 @@ void THD::rollback_item_tree_changes()
select_result::select_result()
{
thd=current_thd;
nest_level= -1;
}
void select_result::send_error(uint errcode,const char *err)

View File

@ -2634,7 +2634,6 @@ class select_result :public Sql_alloc {
protected:
THD *thd;
SELECT_LEX_UNIT *unit;
uint nest_level;
public:
select_result();
virtual ~select_result() {};
@ -2671,12 +2670,6 @@ public:
*/
virtual void cleanup();
void set_thd(THD *thd_arg) { thd= thd_arg; }
/**
The nest level, if supported.
@return
-1 if nest level is undefined, otherwise a positive integer.
*/
int get_nest_level() { return nest_level; }
#ifdef EMBEDDED_LIBRARY
virtual void begin_dataset() {}
#else
@ -2771,14 +2764,6 @@ class select_export :public select_to_file {
CHARSET_INFO *write_cs; // output charset
public:
select_export(sql_exchange *ex) :select_to_file(ex) {}
/**
Creates a select_export to represent INTO OUTFILE <filename> with a
defined level of subquery nesting.
*/
select_export(sql_exchange *ex, uint nest_level_arg) :select_to_file(ex)
{
nest_level= nest_level_arg;
}
~select_export();
int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
bool send_data(List<Item> &items);
@ -2788,15 +2773,6 @@ public:
class select_dump :public select_to_file {
public:
select_dump(sql_exchange *ex) :select_to_file(ex) {}
/**
Creates a select_export to represent INTO DUMPFILE <filename> with a
defined level of subquery nesting.
*/
select_dump(sql_exchange *ex, uint nest_level_arg) :
select_to_file(ex)
{
nest_level= nest_level_arg;
}
int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
bool send_data(List<Item> &items);
};
@ -3267,16 +3243,6 @@ class select_dumpvar :public select_result_interceptor {
public:
List<my_var> var_list;
select_dumpvar() { var_list.empty(); row_count= 0;}
/**
Creates a select_dumpvar to represent INTO <variable> with a defined
level of subquery nesting.
*/
select_dumpvar(uint nest_level_arg)
{
var_list.empty();
row_count= 0;
nest_level= nest_level_arg;
}
~select_dumpvar() {}
int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
bool send_data(List<Item> &items);

Some files were not shown because too many files have changed in this diff Show More