| Question about the level of compression used in mysys/my_compress.c |
|
 |
Index ‹ mysql
|
- Previous
- 1
- Getting Count(*) when using pseudo pivot tables...In the usual case, this SQL
select count(*) from mytable where ...
returns an accurate count of the rows you want.
But how do I go about counting rows from this SQL (the sum...if
statements function as a pseudo pivot query)?
SELECT sum(IF(date_report = ('2005-06-30'),shares,0)) as 'Q2
2005',sum(IF(date_report = '2005-03-31',shares,0)) as 'Q1 2005' from
companies left join positions on co_id = positions_co_id where
positions_co_issue_id = 7194 AND date_report
in('2005-06-30','2005-03-31') group by co_id order by 'Q2 2005' DESC
In this case, I'll end up with a row count of, say, 360. When I try to
count the rows I come up with numbers way different. For instance, this try:
select count(co_id) from companies left join positions on co_id =
positions_co_id where positions_co_issue_id = 7194 AND date_report
in('2005-06-30','2005-03-31')
...might give me 1000, while this one...
select count( distinct co_id) from companies left join positions on
co_id = positions_co_id where positions_co_issue_id = 7194 AND
date_report in('2005-06-30','2005-03-31')
...might give me 320.
I'd sure appreciate any thoughts!
--Brent
- 4
- COALESCEDear MySQLers,
I have a guide for MySQL and it doesn't mention the COALESCE command at all
or how to use it. Does it exist in MySQL, or only in MS SQL? Thanks.
Michael
- 5
- bk commit - mysqldoc@docsrva tree (jon:1.3330)Below is the list of changes that have just been committed into a local
mysqldoc repository of jon. When jon 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://www.mysql.com/doc/I/n/Installing_source_tree.html
ChangeSet
1.3330 05/08/20 08:20:39 email***@***.com +5 -0
Additional RefMan-4.1 edits for Functions chapter.
Misc. fixes/sync.
refman/functions.xml
1.31 05/08/20 08:20:38 email***@***.com +52 -68
Sync fixes.
refman-5.1/functions.xml
1.12 05/08/20 08:20:38 email***@***.com +33 -16
Sync fixes.
refman-5.1/Status
1.4 05/08/20 08:20:37 email***@***.com +2 -2
Misc. fix.
refman-5.0/functions.xml
1.25 05/08/20 08:20:37 email***@***.com +35 -30
Sync fixes.
refman-4.1/functions.xml
1.47 05/08/20 08:20:37 email***@***.com +79 -103
Additional 4.1 version stuff.
Misc. fixes.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jon
# Host: gigan.
# Root: /home/jon/bk/mysqldoc
--- 1.3/refman-5.1/Status 2005-08-07 12:46:05 +10:00
+++ 1.4/refman-5.1/Status 2005-08-20 08:20:37 +10:00
@@ -14,7 +14,6 @@
charset
storage-engines
replication
- environment-variables
installing
using-mysql-programs
client-side-scripts
@@ -29,7 +28,7 @@
triggers
views
information-schema
- precision-math
+ precision-math
- 5.1 chapters (probably/hopefully) needing minimal if any edits:
maxdb
@@ -38,6 +37,7 @@
extending-mysql
problems
regexp
+ environment-variables
- Chapters that are constant across MySQL versions (refman-common tree):
--- 1.11/refman-5.1/functions.xml 2005-08-19 10:55:08 +10:00
+++ 1.12/refman-5.1/functions.xml 2005-08-20 08:20:38 +10:00
@@ -13278,23 +13278,40 @@
<indexterm type="function">
<primary>ROLLUP</primary>
</indexterm>
-
- <remark role="todo">
- Comparison with UNION, WRT complexity, table accesses,
- optimization Statements to create and populate the sales table
- used in the ROLLUP examples... DROP TABLE IF EXISTS sales;
- CREATE TABLE sales ( year INT NOT NULL, country VARCHAR(20) NOT
- NULL, product VARCHAR(32) NOT NULL, profit INT ); INSERT INTO
- sales (product,country,year,profit) VALUES INSERT INTO sales
- VALUES ('Computer', 'India', 2000, 1200), ('TV', 'USA', 2001,
- 150), ('Calculator', 'USA', 2001, 50), ('Computer', 'USA', 2001,
- 1500), ('Computer', 'USA', 2000, 1500), ('Phone', 'Finland',
- 2000, 100), ('Calculator', 'USA', 2000, 75), ('Calculator',
- 'India', 2000, 75), ('TV', 'USA', 2001, 100), ('Computer',
- 'USA', 2001, 1200), ('Computer', 'Finland', 2000, 1500),
- ('Calculator', 'India', 2000, 75), ('Phone', 'Finland', 2001,
- 10);
+
+ <remark role="todo">Comparison with UNION, WRT complexity, table
+ accesses, optimization.
+ </remark>
+ <remark role="note">
+ Statements to create and populate the sales table used in the
+ ROLLUP examples...
</remark>
+<!--
+DROP TABLE IF EXISTS sales;
+CREATE TABLE sales
+(
+ year INT NOT NULL,
+ country VARCHAR(20) NOT NULL,
+ product VARCHAR(32) NOT NULL,
+ profit INT
+);
+
+INSERT INTO sales (product,country,year,profit) VALUES
+INSERT INTO sales VALUES
+ ('Computer', 'India', 2000, 1200),
+ ('TV', 'USA', 2001, 150),
+ ('Calculator', 'USA', 2001, 50),
+ ('Computer', 'USA', 2001, 1500),
+ ('Computer', 'USA', 2000, 1500),
+ ('Phone', 'Finland', 2000, 100),
+ ('Calculator', 'USA', 2000, 75),
+ ('Calculator', 'India', 2000, 75),
+ ('TV', 'USA', 2001, 100),
+ ('Computer', 'USA', 2001, 1200),
+ ('Computer', 'Finland', 2000, 1500),
+ ('Calculator', 'India', 2000, 75),
+ ('Phone', 'Finland', 2001, 10);
+-->
<para>
The <literal>GROUP BY</literal> clause allows a <literal>WITH
--- 1.46/refman-4.1/functions.xml 2005-08-19 10:55:08 +10:00
+++ 1.47/refman-4.1/functions.xml 2005-08-20 08:20:37 +10:00
@@ -3431,7 +3431,8 @@
</row>
<row>
<entry><literal>%</literal></entry>
- <entry>Matches any number of characters, even zero characters</entry>
+ <entry>Matches any number of characters, even zero
+ characters</entry>
</row>
<row>
<entry><literal>_</literal></entry>
@@ -3470,11 +3471,13 @@
</row>
<row>
<entry><literal>\%</literal></entry>
- <entry>Matches one ‘<literal>%</literal>’ character</entry>
+ <entry>Matches one ‘<literal>%</literal>’
+ character</entry>
</row>
<row>
<entry><literal>\_</literal></entry>
- <entry>Matches one ‘<literal>_</literal>’ character</entry>
+ <entry>Matches one ‘<literal>_</literal>’
+ character</entry>
</row>
</tbody>
</tgroup>
@@ -5734,8 +5737,9 @@
</row>
<row>
<entry><literal>%r</literal></entry>
- <entry>Time, 12-hour (<literal>hh:mm:ss</literal> followed by
- <literal>AM</literal> or <literal>PM</literal>)</entry>
+ <entry>Time, 12-hour (<literal>hh:mm:ss</literal>
+ followed by <literal>AM</literal> or
+ <literal>PM</literal>)</entry>
</row>
<row>
<entry><literal>%S</literal></entry>
@@ -5751,27 +5755,30 @@
</row>
<row>
<entry><literal>%U</literal></entry>
- <entry>Week (<literal>00</literal>..<literal>53</literal>), where Sunday is the
- first day of the week</entry>
+ <entry>Week (<literal>00</literal>..<literal>53</literal>),
+ where Sunday is the first day of the week</entry>
</row>
<row>
<entry><literal>%u</literal></entry>
- <entry>Week (<literal>00</literal>..<literal>53</literal>), where Monday is the
- first day of the week</entry>
+ <entry>Week (<literal>00</literal>..<literal>53</literal>),
+ where Monday is the first day of the week</entry>
</row>
<row>
<entry><literal>%V</literal></entry>
- <entry>Week (<literal>01</literal>..<literal>53</literal>), where Sunday is the
- first day of the week; used with <literal>%X</literal></entry>
+ <entry>Week (<literal>01</literal>..<literal>53</literal>),
+ where Sunday is the first day of the week; used with
+ <literal>%X</literal></entry>
</row>
<row>
<entry><literal>%v</literal></entry>
- <entry>Week (<literal>01</literal>..<literal>53</literal>), where Monday is the
- first day of the week; used with <literal>%x</literal></entry>
+ <entry>Week (<literal>01</literal>..<literal>53</literal>),
+ where Monday is the first day of the week; used with
+ <literal>%x</literal></entry>
</row>
<row>
<entry><literal>%W</literal></entry>
- <entry>Weekday name (<literal>Sunday</literal>..<literal>Saturday</literal>)</entry>
+ <entry>Weekday name
+ (<literal>Sunday</literal>..<literal>Saturday</literal>)</entry>
</row>
<row>
<entry><literal>%w</literal></entry>
@@ -5780,13 +5787,15 @@
</row>
<row>
<entry><literal>%X</literal></entry>
- <entry>Year for the week where Sunday is the first day of the week, numeric,
- four digits; used with <literal>%V</literal></entry>
+ <entry>Year for the week where Sunday is the first day
+ of the week, numeric, four digits; used with
+ <literal>%V</literal></entry>
</row>
<row>
<entry><literal>%x</literal></entry>
- <entry>Year for the week, where Monday is the first day of the week, numeric,
- four digits; used with <literal>%v</literal></entry>
+ <entry>Year for the week, where Monday is the first day
+ of the week, numeric, four digits; used with
+ <literal>%v</literal></entry>
</row>
<row>
<entry><literal>%Y</literal></entry>
@@ -7371,7 +7380,8 @@
<entry><emphasis role="bold">Mode</emphasis></entry>
<entry><emphasis role="bold">of week</emphasis></entry>
<entry><emphasis role="bold">Range</emphasis></entry>
- <entry><emphasis role="bold">Week 1 is the first week...</emphasis></entry>
+ <entry><emphasis role="bold">Week 1 is the first
+ week...</emphasis></entry>
</row>
<row>
<entry>0</entry>
@@ -7652,12 +7662,8 @@
</indexterm>
<para>
- MySQL uses what is known as a
-
- <firstterm>proleptic Gregorian
- calendar</firstterm>
-
- .
+ MySQL uses what is known as a <firstterm>proleptic Gregorian
+ calendar</firstterm>.
</para>
<para>
@@ -7719,12 +7725,9 @@
<para>
There are no dates between October 4 and October 15. This
- discontinuity is called the
-
- <firstterm>cutover</firstterm>
-
- . Any dates before the cutover are Julian, and any dates following
- the cutover are Gregorian. Dates during a cutover are nonexistent.
+ discontinuity is called the <firstterm>cutover</firstterm>. Any
+ dates before the cutover are Julian, and any dates following the
+ cutover are Gregorian. Dates during a cutover are nonexistent.
</para>
<para>
@@ -11115,27 +11118,6 @@
<!-- end_description_for_help_topic -->
-<!-- description_for_help_topic SLEEP -->
-
- <listitem>
- <indexterm type="function">
- <primary>SLEEP()</primary>
- </indexterm>
-
- <para>
- <literal>SLEEP(<replaceable>duration</replaceable>)</literal>
- </para>
-
- <para>
- Sleeps (pauses) for the number of seconds given by the
- <replaceable>duration</replaceable> argument, then returns
- 0. The duration may have a fractional part given in
- microseconds. This function was added in MySQL 5.0.12.
- </para>
- </listitem>
-
-<!-- end_description_for_help_topic -->
-
<!-- description_for_help_topic UUID -->
<listitem>
@@ -11260,26 +11242,13 @@
<itemizedlist>
-<!-- description_for_help_topic AVG DISTINCT -->
+<!-- description_for_help_topic AVG -->
<listitem>
<indexterm type="function">
<primary>AVG()</primary>
</indexterm>
- <indexterm type="function">
- <primary>AVG(DISTINCT)</primary>
- </indexterm>
-
- <indexterm type="function">
- <primary>DISTINCT</primary>
- </indexterm>
-
- <para>
- <literal>AVG([DISTINCT]
- <replaceable>expr</replaceable>)</literal>
- </para>
-
<para>
Returns the average value of
<literal><replaceable>expr</replaceable></literal>.
@@ -11564,17 +11533,19 @@
</para>
<!--
- Commented out until someone can say what GROUP_CONCAT() can do
- that LIST() cannot...
+ NOTE: Commented out until someone can say what GROUP_CONCAT() can
+ do that LIST() cannot...
-->
-<!--
- The @code{GROUP_CONCAT()} function is an enhanced implementation
- of the basic @code{LIST()} function supported by Sybase SQL
- Anywhere. @code{GROUP_CONCAT()} is backward compatible with the
- extremely limited functionality of @code{LIST()} if only one
- column and no other options are specified. @code{LIST()} does have
- a default sorting order.
+<!--
+ <para>
+ The <literal>GROUP_CONCAT()</literal> function is an enhanced
+ implementation of the basic <literal>LIST()</literal> function
+ supported by Sybase SQL Anywhere. It is backward compatible with
+ the extremely limited functionality of <literal>LIST()</literal>
+ if only one column and no other options are specified.
+ <literal>LIST()</literal> does have a default sorting order.
+ </para>
-->
<para>
@@ -11729,34 +11700,39 @@
<!--
TODO: Comparison with UNION, WRT complexity, table accesses,
optimization
-
- Statements to create and populate the sales table used in the
- ROLLUP examples...
-
- DROP TABLE IF EXISTS sales;
- CREATE TABLE sales
- (
- year INT NOT NULL,
- country VARCHAR(20) NOT NULL,
- product VARCHAR(32) NOT NULL,
- profit INT
- );
-
- INSERT INTO sales (product,country,year,profit) VALUES
- INSERT INTO sales VALUES
- ('Computer', 'India', 2000, 1200),
- ('TV', 'USA', 2001, 150),
- ('Calculator', 'USA', 2001, 50),
- ('Computer', 'USA', 2001, 1500),
- ('Computer', 'USA', 2000, 1500),
- ('Phone', 'Finland', 2000, 100),
- ('Calculator', 'USA', 2000, 75),
- ('Calculator', 'India', 2000, 75),
- ('TV', 'USA', 2001, 100),
- ('Computer', 'USA', 2001, 1200),
- ('Computer', 'Finland', 2000, 1500),
- ('Calculator', 'India', 2000, 75),
- ('Phone', 'Finland', 2001, 10);
+-->
+<!--
+ NOTE: Statements to create and populate the sales table used in
+ the ROLLUP examples... (Remove <programlisting> tags after comment
+ conversion)
+-->
+<!--
+<programlisting>
+DROP TABLE IF EXISTS sales;
+CREATE TABLE sales
+(
+ year INT NOT NULL,
+ country VARCHAR(20) NOT NULL,
+ product VARCHAR(32) NOT NULL,
+ profit INT
+);
+
+INSERT INTO sales (product,country,year,profit) VALUES
+INSERT INTO sales VALUES
+ ('Computer', 'India', 2000, 1200),
+ ('TV', 'USA', 2001, 150),
+ ('Calculator', 'USA', 2001, 50),
+ ('Computer', 'USA', 2001, 1500),
+ ('Computer', 'USA', 2000, 1500),
+ ('Phone', 'Finland', 2000, 100),
+ ('Calculator', 'USA', 2000, 75),
+ ('Calculator', 'India', 2000, 75),
+ ('TV', 'USA', 2001, 100),
+ ('Computer', 'USA', 2001, 1200),
+ ('Computer', 'Finland', 2000, 1500),
+ ('Calculator', 'India', 2000, 75),
+ ('Phone', 'Finland', 2001, 10);
+</programlisting>
-->
<para>
--- 1.30/refman/functions.xml 2005-08-19 10:55:09 +10:00
+++ 1.31/refman/functions.xml 2005-08-20 08:20:38 +10:00
@@ -11960,19 +11960,21 @@
this maximum length.
</para>
-<!-- commented out until someone can say what GROUP_CONCAT() can do that -->
-
-<!-- LIST() cannot... -->
-
-<!-- The @code{GROUP_CONCAT()} function is an enhanced implementation of -->
-
-<!-- the basic @code{LIST()} function supported by Sybase SQL Anywhere. -->
-
-<!-- @code{GROUP_CONCAT()} is backward compatible with the extremely limited -->
-
-<!-- functionality of @code{LIST()} if only one column and no other options -->
-
-<!-- are specified. @code{LIST()} does have a default sorting order. -->
+<!--
+ NOTE: Commented out until someone can say what GROUP_CONCAT() can
+ do that LIST() cannot...
+-->
+
+<!--
+ <para>
+ The <literal>GROUP_CONCAT()</literal> function is an enhanced
+ implementation of the basic <literal>LIST()</literal> function
+ supported by Sybase SQL Anywhere. It is backward compatible with
+ the extremely limited functionality of <literal>LIST()</literal>
+ if only one column and no other options are specified.
+ <literal>LIST()</literal> does have a default sorting order.
+ </para>
+-->
<para>
<literal>GROUP_CONCAT()</literal> was added in MySQL 4.1.
@@ -12254,61 +12256,43 @@
<primary>ROLLUP</primary>
</indexterm>
-<!-- TODO: Comparison with UNION, WRT: complexity, table accesses, -->
-
-<!-- optimization -->
-
-<!-- Statements to create and populate the sales table used in the -->
-
-<!-- ROLLUP examples -->
-
-<!-- DROP TABLE IF EXISTS sales; -->
-
-<!-- CREATE TABLE sales -->
-
-<!-- ( -->
-
-<!-- year INT NOT NULL, -->
-
-<!-- country VARCHAR(20) NOT NULL, -->
-
-<!-- product VARCHAR(32) NOT NULL, -->
-
-<!-- profit INT -->
-
-<!-- ); -->
-
-<!-- INSERT INTO sales (product,country,year,profit) VALUES -->
-
-<!-- INSERT INTO sales VALUES -->
-
-<!-- ('Computer', 'India', 2000, 1200), -->
-
-<!-- ('TV', 'USA', 2001, 150), -->
-
-<!-- ('Calculator', 'USA', 2001, 50), -->
-
-<!-- ('Computer', 'USA', 2001, 1500), -->
-
-<!-- ('Computer', 'USA', 2000, 1500), -->
-
-<!-- ('Phone', 'Finland', 2000, 100), -->
-
-<!-- ('Calculator', 'USA', 2000, 75), -->
-
-<!-- ('Calculator', 'India', 2000, 75), -->
-
-<!-- ('TV', 'USA', 2001, 100), -->
-
-<!-- ('Computer', 'USA', 2001, 1200), -->
-
-<!-- ('Computer', 'Finland', 2000, 1500), -->
-
-<!-- ('Calculator', 'India', 2000, 75), -->
-
-<!-- ('Phone', 'Finland', 2001, 10) -->
-
-<!-- ; -->
+<!--
+ TODO: Comparison with UNION, WRT complexity, table accesses,
+ optimization
+-->
+<!--
+ NOTE: Statements to create and populate the sales table used in
+ the ROLLUP examples... (Remove <programlisting> tags after comment
+ conversion)
+-->
+<!--
+<programlisting>
+DROP TABLE IF EXISTS sales;
+CREATE TABLE sales
+(
+ year INT NOT NULL,
+ country VARCHAR(20) NOT NULL,
+ product VARCHAR(32) NOT NULL,
+ profit INT
+);
+
+INSERT INTO sales (product,country,year,profit) VALUES
+INSERT INTO sales VALUES
+ ('Computer', 'India', 2000, 1200),
+ ('TV', 'USA', 2001, 150),
+ ('Calculator', 'USA', 2001, 50),
+ ('Computer', 'USA', 2001, 1500),
+ ('Computer', 'USA', 2000, 1500),
+ ('Phone', 'Finland', 2000, 100),
+ ('Calculator', 'USA', 2000, 75),
+ ('Calculator', 'India', 2000, 75),
+ ('TV', 'USA', 2001, 100),
+ ('Computer', 'USA', 2001, 1200),
+ ('Computer', 'Finland', 2000, 1500),
+ ('Calculator', 'India', 2000, 75),
+ ('Phone', 'Finland', 2001, 10);
+</programlisting>
+-->
<para>
As of MySQL 4.1.1, the <literal>GROUP BY</literal> clause allows
--- 1.24/refman-5.0/functions.xml 2005-08-19 10:55:08 +10:00
+++ 1.25/refman-5.0/functions.xml 2005-08-20 08:20:37 +10:00
@@ -11601,8 +11601,8 @@
</para>
<!--
- Commented out until someone can say what GROUP_CONCAT() can do
- that LIST() cannot...
+ NOTE: Commented out until someone can say what GROUP_CONCAT() can
+ do that LIST() cannot...
-->
<!--
@@ -11878,34 +11878,39 @@
<!--
TODO: Comparison with UNION, WRT complexity, table accesses,
optimization
-
- Statements to create and populate the sales table used in the
- ROLLUP examples...
-
- DROP TABLE IF EXISTS sales;
- CREATE TABLE sales
- (
- year INT NOT NULL,
- country VARCHAR(20) NOT NULL,
- product VARCHAR(32) NOT NULL,
- profit INT
- );
-
- INSERT INTO sales (product,country,year,profit) VALUES
- INSERT INTO sales VALUES
- ('Computer', 'India', 2000, 1200),
- ('TV', 'USA', 2001, 150),
- ('Calculator', 'USA', 2001, 50),
- ('Computer', 'USA', 2001, 1500),
- ('Computer', 'USA', 2000, 1500),
- ('Phone', 'Finland', 2000, 100),
- ('Calculator', 'USA', 2000, 75),
- ('Calculator', 'India', 2000, 75),
- ('TV', 'USA', 2001, 100),
- ('Computer', 'USA', 2001, 1200),
- ('Computer', 'Finland', 2000, 1500),
- ('Calculator', 'India', 2000, 75),
- ('Phone', 'Finland', 2001, 10);
+-->
+<!--
+ NOTE: Statements to create and populate the sales table used in
+ the ROLLUP examples... (Remove <programlisting> tags after comment
+ conversion)
+-->
+<!--
+<programlisting>
+DROP TABLE IF EXISTS sales;
+CREATE TABLE sales
+(
+ year INT NOT NULL,
+ country VARCHAR(20) NOT NULL,
+ product VARCHAR(32) NOT NULL,
+ profit INT
+);
+
+INSERT INTO sales (product,country,year,profit) VALUES
+INSERT INTO sales VALUES
+ ('Computer', 'India', 2000, 1200),
+ ('TV', 'USA', 2001, 150),
+ ('Calculator', 'USA', 2001, 50),
+ ('Computer', 'USA', 2001, 1500),
+ ('Computer', 'USA', 2000, 1500),
+ ('Phone', 'Finland', 2000, 100),
+ ('Calculator', 'USA', 2000, 75),
+ ('Calculator', 'India', 2000, 75),
+ ('TV', 'USA', 2001, 100),
+ ('Computer', 'USA', 2001, 1200),
+ ('Computer', 'Finland', 2000, 1500),
+ ('Calculator', 'India', 2000, 75),
+ ('Phone', 'Finland', 2001, 10);
+</programlisting>
-->
<para>
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 5
- Handling Special CharactersI am having trouble inserting special characters into a table. I am using
the MySQL client. I put the following commands into a text file (I'm on
WinXP, using Notepad), copy them, and paste them into the MySQL command line
client.
SET NAMES utf8;
CREATE TEMPORARY TABLE `giiexpr_db`.`eo_name_table` (
`eo_name` VARCHAR( 255 ) NOT NULL
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
INSERT INTO eo_name_table
(eo_name)
VALUES
("Associated British Foods Plc (Abf) - Hot Drinks - World");
SELECT * FROM eo_name_table;
+---------------------------------------------------------+
| eo_name |
+---------------------------------------------------------+
| Associated British Foods Plc (Abf) - Hot Drinks - World |
+---------------------------------------------------------+
1 row in set (0.04 sec)
That symbol before "World" is an N-dash, 0x96. This works perfectly.
Here's where things go wrong. If instead of pasting these commands into the
client, I source the exact same file, I get this:
+-------------------------------------------------+
| eo_name |
+-------------------------------------------------+
| Associated British Foods Plc (Abf) - Hot Drinks |
+-------------------------------------------------+
1 row in set (0.04 sec)
It seems that special characters are treated differently when they are in a
sourced file. It isn't just the N-dash, French accented characters cause the
same problem. These are all single-byte characters.
Just to be sure, I checked the length of the string in the field, and it
accurately reflected the difference. That proves, to my satisfaction, that
the problem is on the input side.
I'm using version 4.1.22 community server on a Linux platform. I'm using
version 5.0.45 of the CLI client.
Anyone have any ideas? I was trying to avoid having to write a program to do
this.
Regards,
Jerry Schwartz
The Infoshop by Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032
860.674.8796 / FAX: 860.674.8341
www.the-infoshop.com
www.giiexpress.com
www.etudes-marche.com
- 5
- mysqld startup problemI'm using ssh to administer a mysql server, version 3.23.49, which I
just installed.
The problem when starting mysqld: I type "mysqld" at the shell prompt
and hit return, then I get the message "mysqld: ready for
connections". But then it doesn't give me back the shell prompt. I can
type stuff on the screen, but it doesn't do anything. I've tried
Ctrl-C and Ctrl-Z, but that does nothing. Any ideas? Thanks.
Paul
- 5
- webmail mysql table questionI am writting a webmail client using mysql as the backend. I wrote the
scripts using a table for each separate user. I am thinkig about putting
all users in one table. the table structure now is
pk, msg, folder. i am thinking about adding a separate field called user
are there any advantages or disadvanges for doing this.
I think some disadvantages could be larger/file table size and need of
locking tables for updates, and probably less security.
the advantages would be to have all the data in one table, and no need to
setup a table for each user.
i am new to my sql i aprreciate some feedback. this is the link for
the demo of the webmail. username demo password password. i am planning on
adding and address book, and bcc and cc fields for new messages. Right now
i get the address from a search feature but most email clients have
addressbook, so i figured i should add one too.
www.wittyadmin.com/demo.html
- 7
- Patches?!Hello
What about patches - #7458, #7464, #7474
--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsub=email***@***.com
- 12
- Connector/J commit: r4286 - tagsAdded:
tags/b5_0-nightly-20050921_000400/
Log:
Tagging the nightly build
Copied: tags/b5_0-nightly-20050921_000400 (from rev 4285, branches/branch_5_0/connector-j)
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 12
- bk commit into 5.1 tree (tulin:1.1919)Below is the list of changes that have just been committed into a local
5.1 repository of ndbdev. When ndbdev 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
ChangeSet
1.1919 05/06/02 20:26:47 email***@***.com +1 -0
SETUP.sh:
added partition handler to -max
BUILD/SETUP.sh
1.43 05/06/02 20:26:23 email***@***.com +2 -2
added partition handler to -max
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: tulin
# Host: dl145b.mysql.com
# Root: /home/ndbdev/tomas/wl2325-wl1354-new
--- 1.42/BUILD/SETUP.sh Thu May 12 15:45:04 2005
+++ 1.43/BUILD/SETUP.sh Thu Jun 2 20:26:23 2005
@@ -48,8 +48,8 @@
c_warnings="$global_warnings -Wunused"
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
-base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-raid --with-openssl --with-raid --with-big-tables"
-max_leave_isam_configs="--with-innodb --with-partition --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-raid --with-openssl --with-raid --with-embedded-server --with-big-tables"
+base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-partition --with-archive-storage-engine --with-raid --with-openssl --with-raid --with-big-tables"
+max_leave_isam_configs="--with-innodb --with-partition --with-berkeley-db --with-ndbcluster --with-partition --with-archive-storage-engine --with-federated-storage-engine --with-raid --with-openssl --with-raid --with-embedded-server --with-big-tables"
max_no_es_configs="$max_leave_isam_configs --without-isam"
max_configs="$max_no_es_configs --with-embedded-server"
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 12
- bk commit into 4.1 tree (jan:1.2222)Below is the list of changes that have just been committed into a local
4.1 repository of jan. When jan 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
ChangeSet
1.2222 05/05/05 08:08:39 email***@***.com +1 -0
Fig compiler error.
sql/ha_innodb.cc
1.195 05/05/05 08:08:32 email***@***.com +1 -0
Fig compiler error.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jan
# Host: hundin.mysql.fi
# Root: /home/jan/mysql-4.1
--- 1.194/sql/ha_innodb.cc Wed May 4 12:01:29 2005
+++ 1.195/sql/ha_innodb.cc Thu May 5 08:08:32 2005
@@ -3766,6 +3766,7 @@
char name2[FN_REFLEN];
char norm_name[FN_REFLEN];
THD *thd= current_thd;
+ ib_longlong auto_inc_value;
DBUG_ENTER("ha_innobase::create");
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 14
- Connector/J commit: r4135 - in branches/branch_3_1/connector-j: . src/com/mysql/jdbcModified:
branches/branch_3_1/connector-j/CHANGES
branches/branch_3_1/connector-j/src/com/mysql/jdbc/CallableStatement.java
Log:
CallableStatement.clearParameters() now clears resources associated
with INOUT/OUTPUT parameters as well as INPUT parameters.
Modified: branches/branch_3_1/connector-j/CHANGES
===================================================================
--- branches/branch_3_1/connector-j/CHANGES 2005-08-24 00:05:55 UTC (rev 4134)
+++ branches/branch_3_1/connector-j/CHANGES 2005-08-24 20:14:50 UTC (rev 4135)
@@ -120,6 +120,9 @@
PacketTooBigExceptions when "max_allowed_packet" is similar in size
to the default "sendBlobChunkSize" which is 1M.
+ - CallableStatement.clearParameters() now clears resources associated
+ with INOUT/OUTPUT parameters as well as INPUT parameters.
+
06-23-05 - Version 3.1.10-stable
- Fixed connecting without a database specified raised an exception
Modified: branches/branch_3_1/connector-j/src/com/mysql/jdbc/CallableStatement.java
===================================================================
--- branches/branch_3_1/connector-j/src/com/mysql/jdbc/CallableStatement.java 2005-08-24 00:05:55 UTC (rev 4134)
+++ branches/branch_3_1/connector-j/src/com/mysql/jdbc/CallableStatement.java 2005-08-24 20:14:50 UTC (rev 4135)
@@ -64,18 +64,18 @@
int index;
+ int inOutModifier;
+
boolean isIn;
boolean isOut;
+ int jdbcType;
+ short nullability;
String paramName;
-
- int jdbcType;
- String typeName;
- int precision;
+ int precision;
int scale;
- short nullability;
- int inOutModifier;
+ String typeName;
CallableStatementParam(String name, int idx, boolean in,
boolean out, int jdbcType, String typeName,
@@ -182,6 +182,18 @@
}
}
+ protected void checkBounds(int paramIndex) throws SQLException {
+ int localParamIndex = paramIndex - 1;
+
+ if ((paramIndex < 0)
+ || (localParamIndex >= this.numParameters)) {
+ throw new SQLException(
+ Messages.getString("CallableStatement.11") + paramIndex //$NON-NLS-1$
+ + Messages.getString("CallableStatement.12") + numParameters //$NON-NLS-1$
+ + Messages.getString("CallableStatement.13"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT); //$NON-NLS-1$
+ }
+ }
+
/*
* (non-Javadoc)
*
@@ -200,28 +212,31 @@
return (CallableStatementParam) this.parameterMap.get(name);
}
- Iterator iterator() {
- return this.parameterList.iterator();
+ public String getParameterClassName(int arg0) throws SQLException {
+ // TODO Auto-generated method stub
+ return null;
}
- int numberOfParameters() {
- return this.numParameters;
- }
-
public int getParameterCount() throws SQLException {
return this.parameterList.size();
}
- public int isNullable(int arg0) throws SQLException {
+ public int getParameterMode(int arg0) throws SQLException {
checkBounds(arg0);
- return getParameter(arg0 - 1).nullability;
+ return getParameter(arg0 - 1).inOutModifier;
}
- public boolean isSigned(int arg0) throws SQLException {
+ public int getParameterType(int arg0) throws SQLException {
checkBounds(arg0);
+
+ return getParameter(arg0 - 1).jdbcType;
+ }
- return false;
+ public String getParameterTypeName(int arg0) throws SQLException {
+ checkBounds(arg0);
+
+ return getParameter(arg0 - 1).typeName;
}
public int getPrecision(int arg0) throws SQLException {
@@ -236,39 +251,24 @@
return getParameter(arg0 - 1).scale;
}
- public int getParameterType(int arg0) throws SQLException {
+ public int isNullable(int arg0) throws SQLException {
checkBounds(arg0);
- return getParameter(arg0 - 1).jdbcType;
+ return getParameter(arg0 - 1).nullability;
}
- public String getParameterTypeName(int arg0) throws SQLException {
+ public boolean isSigned(int arg0) throws SQLException {
checkBounds(arg0);
-
- return getParameter(arg0 - 1).typeName;
- }
- public String getParameterClassName(int arg0) throws SQLException {
- // TODO Auto-generated method stub
- return null;
+ return false;
}
- public int getParameterMode(int arg0) throws SQLException {
- checkBounds(arg0);
-
- return getParameter(arg0 - 1).inOutModifier;
+ Iterator iterator() {
+ return this.parameterList.iterator();
}
- protected void checkBounds(int paramIndex) throws SQLException {
- int localParamIndex = paramIndex - 1;
-
- if ((paramIndex < 0)
- || (localParamIndex >= this.numParameters)) {
- throw new SQLException(
- Messages.getString("CallableStatement.11") + paramIndex //$NON-NLS-1$
- + Messages.getString("CallableStatement.12") + numParameters //$NON-NLS-1$
- + Messages.getString("CallableStatement.13"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT); //$NON-NLS-1$
- }
+ int numberOfParameters() {
+ return this.numParameters;
}
}
@@ -450,6 +450,18 @@
}
}
+ public synchronized void clearParameters() throws SQLException {
+ super.clearParameters();
+
+ try {
+ if (this.outputParameterResults != null) {
+ this.outputParameterResults.close();
+ }
+ } finally {
+ this.outputParameterResults = null;
+ }
+ }
+
private void determineParameterTypes() throws SQLException {
java.sql.ResultSet paramTypesRs = null;
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 15
- JOIN query works with 3.23 but not 4.0.13Hi,
I have a simple join query below which queries the name of schools with count of
student numbers for each school from two tables School,Student.
select sc.name,
Sum(if(student.SNO is not null, 1, 0)) nmbr,
from school sc
left outer join student
on sc.school_id = student.school_id
group by sc.school_id
this runs just 0.30 sec with Mysql3.23 but 30Sec with Mysql 4.0.13.
i could not find a solution.But i suspect from NULL threatment.
tonBalik
- 15
- Feature Request: mysqldumpHi:
I am using mysql 4.1.10 for a while now, and i was wondering how
painful it would be to tweak the mysqldump to support an additional
option, --insert-ignore , which instructs it to create the dump files
with
INSERT IGNORE blah blah
instead of just
INSERT blah blah
i have actually modified a 4.1.10 nightly build src i had downloaded a
while back, and the changes are very minimal.. few lines at the most..
pretty much the same as that required for the "insert delayed" option.
as of now, everytime i want to migrate to a new mysql version, i need
to get hold of the source, and make these minor changes. hence my
request for the same. I can send in the diff's for the changed files, if=20
that will make it easier.
would be great if anyone could point out the possibility of this being
supported in the near future.
thx a ton..
AB
--=20
A great idea need not be complicated.
http://www.cs.ucsb.edu/~bhosle
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 16
- bk commit into 5.0 tree (kent:1.1940)Below is the list of changes that have just been committed into a local
5.0 repository of kent. When kent 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
ChangeSet
1.1940 05/09/13 01:22:11 email***@***.com +1 -0
Merge email***@***.com:/home/bk/mysql-5.0
into mysql.com:/Users/kent/mysql/bk/mysql-5.0
mysql-test/mysql-test-run.pl
1.41 05/09/13 01:22:07 email***@***.com +0 -0
Auto merged
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: kent
# Host: c-724072d5.010-2112-6f72651.cust.bredbandsbolaget.se
# Root: /Users/kent/mysql/bk/mysql-5.0/RESYNC
--- 1.40/mysql-test/mysql-test-run.pl 2005-09-02 02:08:40 +02:00
+++ 1.41/mysql-test/mysql-test-run.pl 2005-09-13 01:22:07 +02:00
@@ -179,6 +179,7 @@
our $exe_mysqltest;
our $exe_slave_mysqld;
our $exe_im;
+our $exe_my_print_defaults;
our $opt_bench= 0;
our $opt_small_bench= 0;
@@ -872,6 +873,8 @@
$exe_mysql= mtr_exe_exists("$path_client_bindir/mysql");
$exe_mysql_fix_system_tables=
mtr_script_exists("$glob_basedir/scripts/mysql_fix_privilege_tables");
+ $exe_my_print_defaults=
+ mtr_script_exists("$glob_basedir/extra/my_print_defaults");
$path_ndb_tools_dir= mtr_path_exists("$glob_basedir/ndb/tools");
$exe_ndb_mgm= "$glob_basedir/ndb/src/mgmclient/ndb_mgm";
}
@@ -887,6 +890,8 @@
$exe_mysql_fix_system_tables=
mtr_script_exists("$path_client_bindir/mysql_fix_privilege_tables",
"$glob_basedir/scripts/mysql_fix_privilege_tables");
+ $exe_my_print_defaults=
+ mtr_script_exists("path_client_bindir/my_print_defaults");
$path_language= mtr_path_exists("$glob_basedir/share/mysql/english/",
"$glob_basedir/share/english/");
@@ -2384,6 +2389,7 @@
$ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
$ENV{'MYSQL_CLIENT_TEST'}= $cmdline_mysql_client_test;
$ENV{'CHARSETSDIR'}= $path_charsetsdir;
+ $ENV{'MYSQL_MY_PRINT_DEFAULTS'}= $exe_my_print_defaults;
$ENV{'NDB_STATUS_OK'}= $flag_ndb_status_ok;
$ENV{'NDB_MGM'}= $exe_ndb_mgm;
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 16
- Problem with mysql4.1.1 alpha (RPM) connector/J 3.1 alpha,Communication link failure: java.io.IOException, cause: Unexpected end of input stream------=_NextPart_000_003E_01C3CBD9.DE9786C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
I am using the mysql4.1.1 rpm release and trying to connect via =
connector/J nighty build mysql-connector-java-3.1-nightly-20031226. I =
could not connect because of the following error. What could be the best =
working nighty builds of Connector/J that i can use or does should I =
revert back to pre 4.1.1 builds. I understand from the documentation =
that it is not downgradable.
java.sql.SQLException: Communication link failure: java.io.IOException, =
underlying cause: Unexpected end of input stream
** BEGIN NESTED EXCEPTION **
java.io.IOException
MESSAGE: Unexpected end of input stream
STACKTRACE:
java.io.IOException: Unexpected end of input stream
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:1080)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:619)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1532)
at com.mysql.jdbc.Connection.<init>(Connection.java:486)
at =
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
:326)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at CopyToTarget.<init>(GSDNew.java:114)
at GSDNew.main(GSDNew.java:77)
** END NESTED EXCEPTION **
new insert query is =3DINSERT INTO person =
VALUES('902','Great1','Worker1')
PERSONdata transfer to target is failed with updated is 0
java.sql.SQLException: Communication link failure: java.io.IOException, =
underlyi
ng cause: Unexpected end of input stream
** BEGIN NESTED EXCEPTION **
java.io.IOException
MESSAGE: Unexpected end of input stream
STACKTRACE:
java.io.IOException: Unexpected end of input stream
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:1080)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:619)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1532)
at com.mysql.jdbc.Connection.<init>(Connection.java:486)
at =
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
:326)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at CopyToTarget.<init>(GSDNew.java:114)
at GSDNew.main(GSDNew.java:77)
** END NESTED EXCEPTION **
Thanks in advance,
Manoj
------=_NextPart_000_003E_01C3CBD9.DE9786C0--
|
| Author |
Message |
mcallaghan

|
Posted: 2006-5-6 11:51:09 |
Top |
mysql, Question about the level of compression used in mysys/my_compress.c
Stewart Smith wrote:
> On Mon, 2006-05-01 at 17:59 -0700, Mark Callaghan wrote:
>> The function my_compress (in mysys/my_compress.c) uses the default level
>> of zlib compression when compressing network packets. For my
>> unscientific sample data 'gzip -1' is 2.5 to 3X faster than 'gzip' (the
>> default level of compression made the result file 25% smaller than the
>> fastest level). With a mysqld compiled to use the fastest level of zlib
>> compression, fetches of large amounts of data were faster when using the
>> fastest level of zlib compression rather than the default. These
>> results held even when the client and server were reasonably far apart
>> (ping time is 60ms).
>>
>> My belief is that compression of network packets is more likely to be
>> useful when the fastest level of zlib compression is used. Of course,
>> MySql clients with really high latency connections to servers or uses
>> where network traffic is significantly more expensive than server CPU
>> time may disagree.
>
> It sounds like it would be a good thing to make configurable. Possibly
> per connection as well :)
>
> I'm sure we'd be willing to help where needed if you wanted to write a
> patch.
OK. I will provide a patch soon. I will try to provide something that
has a global default and can be changed at the session level.
The current compression code allocates two buffers using free/malloc
that are each about as large as the uncompressed packet each time a
packet must be written to the network. I had another change that reduced
that to one call to malloc and free. That change did not have much of an
effect on performance, but I did not run any multi-threaded tests where
calls to malloc and free might be more expensive. I don't know how good
glibc malloc is for threaded apps. I do know that other mallocs are not
so good (Sun has published a paper on the benefits of mtmalloc for MySql).
From my limited understanding of MySql source, it tries to reduce the
number of calls to free and malloc, but the implementation of network
compression might be one case where that is not true.
Is it worth my time to try to prepare a patch that either reduces the
calls to malloc and free to one per flush of a packet to the network
rather than two calls as is currently done? The calls could be further
reduced by caching the allocated buffer as part of the thread context so
that it is only allocated once.
--
Mark Callaghan
email***@***.com
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
|
| |
|
| |
 |
| |
 |
Index ‹ mysql |
- Next
- 1
- Difference in SQL Syntax between Access and MySQL (from VB6 project using ADO)Hello
Apologies for posting to so many groups but this one is difficult to
catagorize precisely
The following code worked fine with a connection to an Access database.
However, I have changed over to MySQL and am getting syntax error messages
with my code.
adoSetRS.Open "select [SetIndex], [Set] from tSet WHERE StatusID = 1 Order
by Set", db, adOpenStatic, adLockOptimistic
I cannot see why there would be any differences in the syntax to query an
Access as opposed to a MySQL database. After all its all SQL.
Or does anyone know different
or have experienced similar
PS The errors are not occuring on any particular part of the statment it
seems quite random
Help greatly appreciated
Ian
- 2
- Find all rows with no matching rows in second tableHello group,
I have two tables:
Table A
a_id name
1 a
2 b
3 c
Table B
b_id a_id flag name
1 2 y x
2 2 n y
3 3 n z
How can I find the rows from table A where there is no matching row (joined
using a_id as key) in table B where flag is "y"?
So in this example I want the entries 1/a and 3/c from table A. 2/b should
not be selected because there is a row in table B with a_id = 2 and
flag="y".
Understandable?
It seems quite impossible to me, but I cannot figure out a reason why it is
impossible, either.
Regards,
Andr?
- 3
- RELEASE CANDIDATE: v3.0.0 rc4 (final, for real this time?)Lots of little improvements and fixes. It's mostly been discussed here
on the list.
I'm not aware of anything else that has to happen. I'm ready to call it
"finished", but am giving you all one last chance to poke holes in it.
Direct link to the sources:
http://tangentsoft.net/mysql++/test/mysql++-3.0.0-rc4.tar.gz
or for the RPM folk:
http://tangentsoft.net/mysql++/test/mysql++-3.0.0-rc4.src.rpm
Beta docs (check out the user manual's breakages chapter!):
http://tangentsoft.net/mysql++/test/doc/userman/
http://tangentsoft.net/mysql++/test/doc/refman/
--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsub=email***@***.com
- 4
- Finding the 'page' number of a record, or its position in resultsetHi,
We have an application which queries our database in 'pages', i.e. uses the same
query repeatedly, with a different "LIMIT x, 20" to display blocks of 20 results.
I'm wondering if there's an easy way (or any way) to find out where in the
resultset a particular record lies. Obviously the query we're paginating could
involve an ORDER clause, so this isn't any information that can be stored in the
table.
I realise that a row in a resultset might not correspond to a record, so I
figure this would involve some kind of subquery, I just don't know what it would
involve.
I realise that this processing could be done in the application, but that would
involve loading the entire resultset into memory, which would pretty much ruin
the point of the pagination.
Hopefully it won't be too painful to work this out
Gareth
- 5
- bk commit into 5.0 tree (marko:1.1905)Below is the list of changes that have just been committed into a local
5.0 repository of marko. When marko 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
ChangeSet
1.1905 05/07/11 13:50:27 email***@***.com +9 -0
InnoDB: Small optimizations
innobase/row/row0sel.c
1.95 05/07/11 13:50:16 email***@***.com +9 -10
Add some UNIV_UNLIKELY hints
innobase/page/page0page.c
1.32 05/07/11 13:50:16 email***@***.com +47 -53
page_copy_rec_list_end_no_locks(),
page_copy_rec_list_end(),
page_copy_rec_list_start(),
page_delete_rec_list_end(),
page_delete_rec_list_start(),
page_move_rec_list_end(),
page_move_rec_list_start():
Remove redundant parameter "page" and eliminate some local variables
innobase/page/page0cur.c
1.28 05/07/11 13:50:16 email***@***.com +144 -114
page_cur_open_on_rnd_user_rec(): Move condition to end of loop
page_cur_insert_rec_write_log(): Eliminate some local variables
page_cur_parse_insert_rec(): Eliminate extra_info_yes to reduce
register spilling on x86
page_cur_insert_rec_low(): Eliminate some local variables
page_copy_rec_list_end_to_created_page(): Remove 2nd parameter;
move termination condition to end of loop, branch less on comp flag
innobase/include/page0page.ic
1.15 05/07/11 13:50:16 email***@***.com +21 -5
page_rec_set_next(): Remove variable "page"
Add page_rec_get_base_extra_size()
innobase/include/page0page.h
1.9 05/07/11 13:50:16 email***@***.com +10 -7
Add page_rec_get_base_extra_size().
page_copy_rec_list_end_no_locks(), page_copy_rec_list_start(),
page_delete_rec_list_end(), page_delete_rec_list_start(),
page_move_rec_list_end(), page_move_rec_list_start():
Remove redundant parameter "page".
innobase/include/page0cur.h
1.9 05/07/11 13:50:16 email***@***.com +0 -1
page_copy_rec_list_end_to_created_page(): Remove 2nd parameter
innobase/include/buf0buf.ic
1.21 05/07/11 13:50:16 email***@***.com +1 -4
Remove temporary variable
innobase/btr/btr0cur.c
1.55 05/07/11 13:50:15 email***@***.com +16 -14
btr_cur_search_to_nth_level(): Move a condition to the end of the
loop, as it cannot hold on the first iteration.
innobase/btr/btr0btr.c
1.45 05/07/11 13:50:15 email***@***.com +7 -7
Remove redundant "page" parameters of some page0page.c functions.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: marko
# Host: hundin.mysql.fi
# Root: /home/marko/mysql-5.0-current
--- 1.44/innobase/btr/btr0btr.c 2005-06-27 18:57:25 +03:00
+++ 1.45/innobase/btr/btr0btr.c 2005-07-11 13:50:15 +03:00
@@ -876,7 +876,7 @@
/* Copy the records from the temporary space to the recreated page;
do not copy the lock bits yet */
- page_copy_rec_list_end_no_locks(page, new_page,
+ page_copy_rec_list_end_no_locks(page,
page_get_infimum_rec(new_page), index, mtr);
/* Copy max trx id to recreated page */
page_set_max_trx_id(page, page_get_max_trx_id(new_page));
@@ -1025,7 +1025,7 @@
/* Move the records from root to the new page */
- page_move_rec_list_end(new_page, root, page_get_infimum_rec(root),
+ page_move_rec_list_end(new_page, page_get_infimum_rec(root),
cursor->index, mtr);
/* If this is a pessimistic insert which is actually done to
perform a pessimistic update then we have stored the lock
@@ -1681,7 +1681,7 @@
if (direction == FSP_DOWN) {
/* fputs("Split left\n", stderr); */
- page_move_rec_list_start(new_page, page, move_limit,
+ page_move_rec_list_start(new_page, move_limit,
cursor->index, mtr);
left_page = new_page;
right_page = page;
@@ -1690,7 +1690,7 @@
} else {
/* fputs("Split right\n", stderr); */
- page_move_rec_list_end(new_page, page, move_limit,
+ page_move_rec_list_end(new_page, move_limit,
cursor->index, mtr);
left_page = page;
right_page = new_page;
@@ -1958,7 +1958,7 @@
btr_page_empty(father_page, mtr);
/* Move records to the father */
- page_copy_rec_list_end(father_page, page, page_get_infimum_rec(page),
+ page_copy_rec_list_end(father_page, page_get_infimum_rec(page),
index, mtr);
lock_update_copy_and_discard(father_page, page);
@@ -2120,14 +2120,14 @@
if (is_left) {
orig_pred = page_rec_get_prev(
page_get_supremum_rec(merge_page));
- page_copy_rec_list_start(merge_page, page,
+ page_copy_rec_list_start(merge_page,
page_get_supremum_rec(page), cursor->index, mtr);
lock_update_merge_left(merge_page, orig_pred, page);
} else {
orig_succ = page_rec_get_next(
page_get_infimum_rec(merge_page));
- page_copy_rec_list_end(merge_page, page,
+ page_copy_rec_list_end(merge_page,
page_get_infimum_rec(page), cursor->index, mtr);
lock_update_merge_right(orig_succ, page);
--- 1.54/innobase/btr/btr0cur.c 2005-07-05 12:10:10 +03:00
+++ 1.55/innobase/btr/btr0cur.c 2005-07-11 13:50:15 +03:00
@@ -405,19 +405,6 @@
/* Loop and search until we arrive at the desired level */
for (;;) {
- if ((height == 0) && (latch_mode <= BTR_MODIFY_LEAF)) {
-
- rw_latch = latch_mode;
-
- if (insert_planned && ibuf_should_try(index,
- ignore_sec_unique)) {
-
- /* Try insert to the insert buffer if the
- page is not in the buffer pool */
-
- buf_mode = BUF_GET_IF_IN_POOL;
- }
- }
retry_page_get:
page = buf_page_get_gen(space, page_no, rw_latch, guess,
buf_mode,
@@ -460,7 +447,7 @@
ut_ad(0 == ut_dulint_cmp(tree->id,
btr_page_get_index_id(page)));
- if (height == ULINT_UNDEFINED) {
+ if (UNIV_UNLIKELY(height == ULINT_UNDEFINED)) {
/* We are in the root node */
height = btr_page_get_level(page, mtr);
@@ -522,6 +509,21 @@
ut_ad(height > 0);
height--;
+
+ if ((height == 0) && (latch_mode <= BTR_MODIFY_LEAF)) {
+
+ rw_latch = latch_mode;
+
+ if (insert_planned && ibuf_should_try(index,
+ ignore_sec_unique)) {
+
+ /* Try insert to the insert buffer if the
+ page is not in the buffer pool */
+
+ buf_mode = BUF_GET_IF_IN_POOL;
+ }
+ }
+
guess = NULL;
node_ptr = page_cur_get_rec(page_cursor);
--- 1.20/innobase/include/buf0buf.ic 2005-06-15 12:50:18 +03:00
+++ 1.21/innobase/include/buf0buf.ic 2005-07-11 13:50:16 +03:00
@@ -614,8 +614,6 @@
RW_NO_LATCH */
mtr_t* mtr) /* in: mtr */
{
- ulint buf_fix_count;
-
ut_ad(block);
mutex_enter_fast(&(buf_pool->mutex));
@@ -631,8 +629,7 @@
#ifdef UNIV_SYNC_DEBUG
rw_lock_s_unlock(&(block->debug_latch));
#endif
- buf_fix_count = block->buf_fix_count;
- block->buf_fix_count = buf_fix_count - 1;
+ block->buf_fix_count--;
mutex_exit(&(buf_pool->mutex));
--- 1.8/innobase/include/page0cur.h 2005-06-30 11:14:57 +03:00
+++ 1.9/innobase/include/page0cur.h 2005-07-11 13:50:16 +03:00
@@ -173,7 +173,6 @@
page_copy_rec_list_end_to_created_page(
/*===================================*/
page_t* new_page, /* in: index page to copy to */
- page_t* page, /* in: index page */
rec_t* rec, /* in: first record to copy */
dict_index_t* index, /* in: record descriptor */
mtr_t* mtr); /* in: mtr */
--- 1.8/innobase/include/page0page.h 2005-04-25 10:14:26 +03:00
+++ 1.9/innobase/include/page0page.h 2005-07-11 13:50:16 +03:00
@@ -513,6 +513,16 @@
/* out: free space */
ulint comp) /* in: nonzero=compact page format */
__attribute__((const));
+/**************************************************************
+Returns the base extra size of a physical record. This is the
+size of the fixed header, independent of the record size. */
+UNIV_INLINE
+ulint
+page_rec_get_base_extra_size(
+/*=========================*/
+ /* out: REC_N_NEW_EXTRA_BYTES
+ or REC_N_OLD_EXTRA_BYTES */
+ const rec_t* rec); /* in: physical record */
/****************************************************************
Returns the sum of the sizes of the records in the record list
excluding the infimum and supremum records. */
@@ -564,7 +574,6 @@
page_copy_rec_list_end_no_locks(
/*============================*/
page_t* new_page, /* in: index page to copy to */
- page_t* page, /* in: index page */
rec_t* rec, /* in: record on page */
dict_index_t* index, /* in: record descriptor */
mtr_t* mtr); /* in: mtr */
@@ -577,7 +586,6 @@
page_copy_rec_list_end(
/*===================*/
page_t* new_page, /* in: index page to copy to */
- page_t* page, /* in: index page */
rec_t* rec, /* in: record on page */
dict_index_t* index, /* in: record descriptor */
mtr_t* mtr); /* in: mtr */
@@ -590,7 +598,6 @@
page_copy_rec_list_start(
/*=====================*/
page_t* new_page, /* in: index page to copy to */
- page_t* page, /* in: index page */
rec_t* rec, /* in: record on page */
dict_index_t* index, /* in: record descriptor */
mtr_t* mtr); /* in: mtr */
@@ -601,7 +608,6 @@
void
page_delete_rec_list_end(
/*=====================*/
- page_t* page, /* in: index page */
rec_t* rec, /* in: record on page */
dict_index_t* index, /* in: record descriptor */
ulint n_recs, /* in: number of records to delete,
@@ -617,7 +623,6 @@
void
page_delete_rec_list_start(
/*=======================*/
- page_t* page, /* in: index page */
rec_t* rec, /* in: record on page */
dict_index_t* index, /* in: record descriptor */
mtr_t* mtr); /* in: mtr */
@@ -629,7 +634,6 @@
page_move_rec_list_end(
/*===================*/
page_t* new_page, /* in: index page where to move */
- page_t* page, /* in: index page */
rec_t* split_rec, /* in: first record to move */
dict_index_t* index, /* in: record descriptor */
mtr_t* mtr); /* in: mtr */
@@ -641,7 +645,6 @@
page_move_rec_list_start(
/*=====================*/
page_t* new_page, /* in: index page where to move */
- page_t* page, /* in: index page */
rec_t* split_rec, /* in: first record not to move */
dict_index_t* index, /* in: record descriptor */
mtr_t* mtr); /* in: mtr */
--- 1.14/innobase/include/page0page.ic 2005-06-16 16:59:41 +03:00
+++ 1.15/innobase/include/page0page.ic 2005-07-11 13:50:16 +03:00
@@ -588,22 +588,21 @@
rec_t* next) /* in: pointer to next record, must not be page
infimum */
{
- page_t* page;
ulint offs;
ut_ad(page_rec_check(rec));
ut_ad(!page_rec_is_supremum(rec));
- page = ut_align_down(rec, UNIV_PAGE_SIZE);
if (next) {
ut_ad(!page_rec_is_infimum(next));
- ut_ad(page == ut_align_down(next, UNIV_PAGE_SIZE));
- offs = (ulint) (next - page);
+ ut_ad(ut_align_down(rec, UNIV_PAGE_SIZE)
+ == ut_align_down(next, UNIV_PAGE_SIZE));
+ offs = ut_align_offset(next, UNIV_PAGE_SIZE);
} else {
offs = 0;
}
- rec_set_next_offs(rec, page_is_comp(page), offs);
+ rec_set_next_offs(rec, page_rec_is_comp(rec), offs);
}
/****************************************************************
@@ -668,6 +667,23 @@
}
return(rec);
+}
+
+/**************************************************************
+Returns the base extra size of a physical record. This is the
+size of the fixed header, independent of the record size. */
+UNIV_INLINE
+ulint
+page_rec_get_base_extra_size(
+/*=========================*/
+ /* out: REC_N_NEW_EXTRA_BYTES
+ or REC_N_OLD_EXTRA_BYTES */
+ const rec_t* rec) /* in: physical record */
+{
+#if REC_N_NEW_EXTRA_BYTES + 1 != REC_N_OLD_EXTRA_BYTES
+# error "REC_N_NEW_EXTRA_BYTES + 1 != REC_N_OLD_EXTRA_BYTES"
+#endif
+ return(REC_N_NEW_EXTRA_BYTES + !page_rec_is_comp(rec));
}
/****************************************************************
--- 1.27/innobase/page/page0cur.c 2005-07-05 12:10:10 +03:00
+++ 1.28/innobase/page/page0cur.c 2005-07-11 13:50:16 +03:00
@@ -483,7 +483,7 @@
ulint rnd;
rec_t* rec;
- if (page_get_n_recs(page) == 0) {
+ if (UNIV_UNLIKELY(page_get_n_recs(page) == 0)) {
page_cur_position(page_get_infimum_rec(page), cursor);
return;
@@ -495,13 +495,9 @@
rec = page_get_infimum_rec(page);
- rec = page_rec_get_next(rec);
-
- while (rnd > 0) {
+ do {
rec = page_rec_get_next(rec);
-
- rnd--;
- }
+ } while (rnd-- > 0);
page_cur_position(rec, cursor);
}
@@ -522,19 +518,14 @@
ulint cur_rec_size;
ulint extra_size;
ulint cur_extra_size;
- ulint min_rec_size;
- byte* ins_ptr;
- byte* cur_ptr;
- ulint extra_info_yes;
+ const byte* ins_ptr;
byte* log_ptr;
- byte* log_end;
+ const byte* log_end;
ulint i;
- ulint comp;
ut_a(rec_size < UNIV_PAGE_SIZE);
ut_ad(buf_frame_align(insert_rec) == buf_frame_align(cursor_rec));
ut_ad(!page_rec_is_comp(insert_rec) == !index->table->comp);
- comp = page_rec_is_comp(insert_rec);
{
mem_heap_t* heap = NULL;
@@ -567,45 +558,55 @@
i = 0;
if (cur_extra_size == extra_size) {
- min_rec_size = ut_min(cur_rec_size, rec_size);
+ ulint min_rec_size = ut_min(cur_rec_size, rec_size);
- cur_ptr = cursor_rec - cur_extra_size;
+ const byte* cur_ptr = cursor_rec - cur_extra_size;
/* Find out the first byte in insert_rec which differs from
cursor_rec; skip the bytes in the record info */
- for (;;) {
- if (i >= min_rec_size) {
-
- break;
- } else if (*ins_ptr == *cur_ptr) {
+ do {
+ if (*ins_ptr == *cur_ptr) {
i++;
ins_ptr++;
cur_ptr++;
} else if ((i < extra_size)
- && (i >= extra_size - (comp
- ? REC_N_NEW_EXTRA_BYTES
- : REC_N_OLD_EXTRA_BYTES))) {
+ && (i >= extra_size -
+ page_rec_get_base_extra_size(
+ insert_rec))) {
i = extra_size;
ins_ptr = insert_rec;
cur_ptr = cursor_rec;
} else {
break;
}
- }
+ } while (i < min_rec_size);
}
if (mtr_get_log_mode(mtr) != MTR_LOG_SHORT_INSERTS) {
- log_ptr = mlog_open_and_write_index(mtr, insert_rec, index,
- comp
- ? MLOG_COMP_REC_INSERT : MLOG_REC_INSERT,
- 2 + 5 + 1 + 5 + 5 + MLOG_BUF_MARGIN);
+ if (page_rec_is_comp(insert_rec)) {
+ log_ptr = mlog_open_and_write_index(mtr, insert_rec,
+ index, MLOG_COMP_REC_INSERT,
+ 2 + 5 + 1 + 5 + 5 + MLOG_BUF_MARGIN);
+ if (UNIV_UNLIKELY(!log_ptr)) {
+ /* Logging in mtr is switched off
+ during crash recovery: in that case
+ mlog_open returns NULL */
+ return;
+ }
+ } else {
+ log_ptr = mlog_open(mtr, 11
+ + 2 + 5 + 1 + 5 + 5 + MLOG_BUF_MARGIN);
+ if (UNIV_UNLIKELY(!log_ptr)) {
+ /* Logging in mtr is switched off
+ during crash recovery: in that case
+ mlog_open returns NULL */
+ return;
+ }
- if (!log_ptr) {
- /* Logging in mtr is switched off during crash
- recovery: in that case mlog_open returns NULL */
- return;
+ log_ptr = mlog_write_initial_log_record_fast(
+ insert_rec, MLOG_REC_INSERT, log_ptr, mtr);
}
log_end = &log_ptr[2 + 5 + 1 + 5 + 5 + MLOG_BUF_MARGIN];
@@ -623,24 +624,33 @@
log_end = &log_ptr[5 + 1 + 5 + 5 + MLOG_BUF_MARGIN];
}
- if ((rec_get_info_and_status_bits(insert_rec, comp) !=
- rec_get_info_and_status_bits(cursor_rec, comp))
- || (extra_size != cur_extra_size)
- || (rec_size != cur_rec_size)) {
+ if (page_rec_is_comp(insert_rec)) {
+ if (UNIV_UNLIKELY
+ (rec_get_info_and_status_bits(insert_rec, TRUE) !=
+ rec_get_info_and_status_bits(cursor_rec, TRUE))) {
- extra_info_yes = 1;
+ goto need_extra_info;
+ }
} else {
- extra_info_yes = 0;
+ if (UNIV_UNLIKELY
+ (rec_get_info_and_status_bits(insert_rec, FALSE) !=
+ rec_get_info_and_status_bits(cursor_rec, FALSE))) {
+
+ goto need_extra_info;
+ }
}
-
- /* Write the record end segment length and the extra info storage
- flag */
- log_ptr += mach_write_compressed(log_ptr, 2 * (rec_size - i)
- + extra_info_yes);
- if (extra_info_yes) {
+
+ if (extra_size != cur_extra_size || rec_size != cur_rec_size) {
+need_extra_info:
+ /* Write the record end segment length
+ and the extra info storage flag */
+ log_ptr += mach_write_compressed(log_ptr,
+ 2 * (rec_size - i) + 1);
+
/* Write the info bits */
mach_write_to_1(log_ptr,
- rec_get_info_and_status_bits(insert_rec, comp));
+ rec_get_info_and_status_bits(insert_rec,
+ page_rec_is_comp(insert_rec)));
log_ptr++;
/* Write the record origin offset */
@@ -651,8 +661,12 @@
ut_a(i < UNIV_PAGE_SIZE);
ut_a(extra_size < UNIV_PAGE_SIZE);
+ } else {
+ /* Write the record end segment length
+ and the extra info storage flag */
+ log_ptr += mach_write_compressed(log_ptr, 2 * (rec_size - i));
}
-
+
/* Write to the log the inserted index record end segment which
differs from the cursor record */
@@ -682,7 +696,6 @@
page_t* page, /* in: page or NULL */
mtr_t* mtr) /* in: mtr or NULL */
{
- ulint extra_info_yes;
ulint offset = 0; /* remove warning */
ulint origin_offset;
ulint end_seg_len;
@@ -725,16 +738,13 @@
return(NULL);
}
- extra_info_yes = end_seg_len & 0x1UL;
- end_seg_len >>= 1;
-
- if (end_seg_len >= UNIV_PAGE_SIZE) {
+ if (UNIV_UNLIKELY(end_seg_len >= UNIV_PAGE_SIZE << 1)) {
recv_sys->found_corrupt_log = TRUE;
return(NULL);
}
- if (extra_info_yes) {
+ if (end_seg_len & 0x1UL) {
/* Read the info bits */
if (end_ptr < ptr + 1) {
@@ -764,17 +774,17 @@
ut_a(mismatch_index < UNIV_PAGE_SIZE);
}
- if (end_ptr < ptr + end_seg_len) {
+ if (end_ptr < ptr + (end_seg_len >> 1)) {
return(NULL);
}
if (page == NULL) {
- return(ptr + end_seg_len);
+ return(ptr + (end_seg_len >> 1));
}
- ut_ad(!!page_is_comp(page) == index->table->comp);
+ ut_ad((ibool) !!page_is_comp(page) == index->table->comp);
/* Read from the log the inserted index record end segment which
differs from the cursor record */
@@ -788,12 +798,14 @@
offsets = rec_get_offsets(cursor_rec, index, offsets,
ULINT_UNDEFINED, &heap);
- if (extra_info_yes == 0) {
+ if (!(end_seg_len & 0x1UL)) {
info_and_status_bits = rec_get_info_and_status_bits(
cursor_rec, page_is_comp(page));
origin_offset = rec_offs_extra_size(offsets);
- mismatch_index = rec_offs_size(offsets) - end_seg_len;
+ mismatch_index = rec_offs_size(offsets) - (end_seg_len >> 1);
}
+
+ end_seg_len >>= 1;
if (mismatch_index + end_seg_len < sizeof buf1) {
buf = buf1;
@@ -873,14 +885,7 @@
ulint heap_no; /* heap number of the inserted record */
rec_t* current_rec; /* current record after which the
new record is inserted */
- rec_t* next_rec; /* next record after current before
- the insertion */
- ulint owner_slot; /* the slot which owns the
- inserted record */
- rec_t* owner_rec;
- ulint n_owned;
mem_heap_t* heap = NULL;
- ulint comp;
ut_ad(cursor && mtr);
ut_ad(tuple || rec);
@@ -888,10 +893,9 @@
ut_ad(rec || dtuple_check_typed(tuple));
page = page_cur_get_page(cursor);
- comp = page_is_comp(page);
- ut_ad(index->table->comp == !!comp);
+ ut_ad(index->table->comp == (ibool) !!page_is_comp(page));
- ut_ad(cursor->rec != page_get_supremum_rec(page));
+ ut_ad(!page_rec_is_supremum(cursor->rec));
/* 1. Get the size of the physical record in the page */
if (tuple != NULL) {
@@ -908,7 +912,7 @@
/* 2. Try to find suitable space from page memory management */
insert_buf = page_mem_alloc(page, rec_size, index, &heap_no);
- if (insert_buf == NULL) {
+ if (UNIV_UNLIKELY(insert_buf == NULL)) {
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
@@ -933,30 +937,41 @@
/* 4. Insert the record in the linked list of records */
current_rec = cursor->rec;
- ut_ad(!comp || rec_get_status(current_rec) <= REC_STATUS_INFIMUM);
- ut_ad(!comp || rec_get_status(insert_rec) < REC_STATUS_INFIMUM);
-
- next_rec = page_rec_get_next(current_rec);
- ut_ad(!comp || rec_get_status(next_rec) != REC_STATUS_INFIMUM);
- page_rec_set_next(insert_rec, next_rec);
- page_rec_set_next(current_rec, insert_rec);
+ {
+ /* next record after current before the insertion */
+ rec_t* next_rec = page_rec_get_next(current_rec);
+#ifdef UNIV_DEBUG
+ if (page_is_comp(page)) {
+ ut_ad(rec_get_status(current_rec)
+ <= REC_STATUS_INFIMUM);
+ ut_ad(rec_get_status(insert_rec) < REC_STATUS_INFIMUM);
+ ut_ad(rec_get_status(next_rec) != REC_STATUS_INFIMUM);
+ }
+#endif
+ page_rec_set_next(insert_rec, next_rec);
+ page_rec_set_next(current_rec, insert_rec);
+ }
page_header_set_field(page, PAGE_N_RECS, 1 + page_get_n_recs(page));
/* 5. Set the n_owned field in the inserted record to zero,
and set the heap_no field */
-
- rec_set_n_owned(insert_rec, comp, 0);
- rec_set_heap_no(insert_rec, comp, heap_no);
+ if (page_is_comp(page)) {
+ rec_set_n_owned(insert_rec, TRUE, 0);
+ rec_set_heap_no(insert_rec, TRUE, heap_no);
+ } else {
+ rec_set_n_owned(insert_rec, FALSE, 0);
+ rec_set_heap_no(insert_rec, FALSE, heap_no);
+ }
/* 6. Update the last insertion info in page header */
last_insert = page_header_get_ptr(page, PAGE_LAST_INSERT);
- ut_ad(!last_insert || !comp
+ ut_ad(!last_insert || !page_is_comp(page)
|| rec_get_node_ptr_flag(last_insert)
== rec_get_node_ptr_flag(insert_rec));
- if (last_insert == NULL) {
+ if (UNIV_UNLIKELY(last_insert == NULL)) {
page_header_set_field(page, PAGE_DIRECTION, PAGE_NO_DIRECTION);
page_header_set_field(page, PAGE_N_DIRECTION, 0);
@@ -981,18 +996,25 @@
page_header_set_ptr(page, PAGE_LAST_INSERT, insert_rec);
/* 7. It remains to update the owner record. */
-
- owner_rec = page_rec_find_owner_rec(insert_rec);
- n_owned = rec_get_n_owned(owner_rec, comp);
- rec_set_n_owned(owner_rec, comp, n_owned + 1);
-
- /* 8. Now we have incremented the n_owned field of the owner
- record. If the number exceeds PAGE_DIR_SLOT_MAX_N_OWNED,
- we have to split the corresponding directory slot in two. */
-
- if (n_owned == PAGE_DIR_SLOT_MAX_N_OWNED) {
- owner_slot = page_dir_find_owner_slot(owner_rec);
- page_dir_split_slot(page, owner_slot);
+ {
+ rec_t* owner_rec = page_rec_find_owner_rec(insert_rec);
+ ulint n_owned;
+ if (page_is_comp(page)) {
+ n_owned = rec_get_n_owned(owner_rec, TRUE);
+ rec_set_n_owned(owner_rec, TRUE, n_owned + 1);
+ } else {
+ n_owned = rec_get_n_owned(owner_rec, FALSE);
+ rec_set_n_owned(owner_rec, FALSE, n_owned + 1);
+ }
+
+ /* 8. Now we have incremented the n_owned field of the owner
+ record. If the number exceeds PAGE_DIR_SLOT_MAX_N_OWNED,
+ we have to split the corresponding directory slot in two. */
+
+ if (UNIV_UNLIKELY(n_owned == PAGE_DIR_SLOT_MAX_N_OWNED)) {
+ page_dir_split_slot(page,
+ page_dir_find_owner_slot(owner_rec));
+ }
}
/* 9. Write log record of the insert */
@@ -1089,7 +1111,6 @@
page_copy_rec_list_end_to_created_page(
/*===================================*/
page_t* new_page, /* in: index page to copy to */
- page_t* page, /* in: index page */
rec_t* rec, /* in: first record to copy */
dict_index_t* index, /* in: record descriptor */
mtr_t* mtr) /* in: mtr */
@@ -1105,22 +1126,21 @@
ulint log_mode;
byte* log_ptr;
ulint log_data_len;
- ulint comp = page_is_comp(page);
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
ut_ad(page_dir_get_n_heap(new_page) == 2);
- ut_ad(page != new_page);
- ut_ad(comp == page_is_comp(new_page));
+ ut_ad(ut_align_down(rec, UNIV_PAGE_SIZE) != new_page);
+ ut_ad(page_rec_is_comp(rec) == page_is_comp(new_page));
- if (rec == page_get_infimum_rec(page)) {
+ if (page_rec_is_infimum(rec)) {
rec = page_rec_get_next(rec);
}
- if (rec == page_get_supremum_rec(page)) {
+ if (page_rec_is_supremum(rec)) {
return;
}
@@ -1143,7 +1163,7 @@
log_mode = mtr_set_log_mode(mtr, MTR_LOG_SHORT_INSERTS);
prev_rec = page_get_infimum_rec(new_page);
- if (comp) {
+ if (page_is_comp(new_page)) {
heap_top = new_page + PAGE_NEW_SUPREMUM_END;
} else {
heap_top = new_page + PAGE_OLD_SUPREMUM_END;
@@ -1152,16 +1172,24 @@
slot_index = 0;
n_recs = 0;
- /* should be do ... until, comment by Jani */
- while (rec != page_get_supremum_rec(page)) {
+ do {
offsets = rec_get_offsets(rec, index, offsets,
ULINT_UNDEFINED, &heap);
insert_rec = rec_copy(heap_top, rec, offsets);
- rec_set_next_offs(prev_rec, comp, insert_rec - new_page);
+ if (page_is_comp(new_page)) {
+ rec_set_next_offs(prev_rec, TRUE,
+ ut_align_offset(insert_rec, UNIV_PAGE_SIZE));
+
+ rec_set_n_owned(insert_rec, TRUE, 0);
+ rec_set_heap_no(insert_rec, TRUE, 2 + n_recs);
+ } else {
+ rec_set_next_offs(prev_rec, FALSE,
+ ut_align_offset(insert_rec, UNIV_PAGE_SIZE));
- rec_set_n_owned(insert_rec, comp, 0);
- rec_set_heap_no(insert_rec, comp, 2 + n_recs);
+ rec_set_n_owned(insert_rec, FALSE, 0);
+ rec_set_heap_no(insert_rec, FALSE, 2 + n_recs);
+ }
rec_size = rec_offs_size(offsets);
@@ -1188,7 +1216,7 @@
index, mtr);
prev_rec = insert_rec;
rec = page_rec_get_next(rec);
- }
+ } while (!page_rec_is_supremum(rec));
if ((slot_index > 0) && (count + 1
+ (PAGE_DIR_SLOT_MAX_N_OWNED + 1) / 2
@@ -1216,9 +1244,12 @@
ut_a(log_data_len < 100 * UNIV_PAGE_SIZE);
mach_write_to_4(log_ptr, log_data_len);
-
- rec_set_next_offs(insert_rec, comp,
- comp ? PAGE_NEW_SUPREMUM : PAGE_OLD_SUPREMUM);
+
+ if (page_is_comp(new_page)) {
+ rec_set_next_offs(insert_rec, TRUE, PAGE_NEW_SUPREMUM);
+ } else {
+ rec_set_next_offs(insert_rec, FALSE, PAGE_OLD_SUPREMUM);
+ }
slot = page_dir_get_nth_slot(new_page, 1 + slot_index);
@@ -1251,7 +1282,7 @@
{
byte* log_ptr;
- ut_ad(!!page_rec_is_comp(rec) == index->table->comp);
+ ut_ad((ibool) !!page_rec_is_comp(rec) == index->table->comp);
log_ptr = mlog_open_and_write_index(mtr, rec, index,
page_rec_is_comp(rec)
@@ -1343,12 +1374,11 @@
page = page_cur_get_page(cursor);
current_rec = cursor->rec;
ut_ad(rec_offs_validate(current_rec, index, offsets));
- ut_ad(!!page_is_comp(page) == index->table->comp);
+ ut_ad((ibool) !!page_is_comp(page) == index->table->comp);
/* The record must not be the supremum or infimum record. */
- ut_ad(current_rec != page_get_supremum_rec(page));
- ut_ad(current_rec != page_get_infimum_rec(page));
-
+ ut_ad(page_rec_is_user_rec(current_rec));
+
/* Save to local variables some data associated with current_rec */
cur_slot_no = page_dir_find_owner_slot(current_rec);
cur_dir_slot = page_dir_get_nth_slot(page, cur_slot_no);
--- 1.31/innobase/page/page0page.c 2005-06-27 18:58:06 +03:00
+++ 1.32/innobase/page/page0page.c 2005-07-11 13:50:16 +03:00
@@ -463,7 +463,6 @@
page_copy_rec_list_end_no_locks(
/*============================*/
page_t* new_page, /* in: index page to copy to */
- page_t* page, /* in: index page */
rec_t* rec, /* in: record on page */
dict_index_t* index, /* in: record descriptor */
mtr_t* mtr) /* in: mtr */
@@ -484,7 +483,7 @@
}
ut_a((ibool)!!page_is_comp(new_page) == index->table->comp);
- ut_a(page_is_comp(new_page) == page_is_comp(page));
+ ut_a(page_is_comp(new_page) == page_rec_is_comp(rec));
ut_a(mach_read_from_2(new_page + UNIV_PAGE_SIZE - 10) == (ulint)
(page_is_comp(new_page)
? PAGE_NEW_INFIMUM : PAGE_OLD_INFIMUM));
@@ -493,7 +492,7 @@
/* Copy records from the original page to the new page */
- sup = page_get_supremum_rec(page);
+ sup = page_get_supremum_rec(ut_align_down(rec, UNIV_PAGE_SIZE));
for (;;) {
rec_t* cur1_rec = page_cur_get_rec(&cur1);
@@ -508,14 +507,16 @@
list on June 18th, 2003 */
buf_page_print(new_page);
- buf_page_print(page);
+ buf_page_print(ut_align_down(rec, UNIV_PAGE_SIZE));
ut_print_timestamp(stderr);
fprintf(stderr,
"InnoDB: rec offset %lu, cur1 offset %lu, cur2 offset %lu\n",
- (ulong)(rec - page),
- (ulong)(page_cur_get_rec(&cur1) - page),
- (ulong)(page_cur_get_rec(&cur2) - new_page));
+ (ulong)ut_align_offset(rec, UNIV_PAGE_SIZE),
+ (ulong)ut_align_offset(page_cur_get_rec(&cur1),
+ UNIV_PAGE_SIZE),
+ (ulong)ut_align_offset(page_cur_get_rec(&cur2),
+ UNIV_PAGE_SIZE));
ut_error;
}
@@ -537,19 +538,20 @@
page_copy_rec_list_end(
/*===================*/
page_t* new_page, /* in: index page to copy to */
- page_t* page, /* in: index page */
rec_t* rec, /* in: record on page */
dict_index_t* index, /* in: record descriptor */
mtr_t* mtr) /* in: mtr */
{
+ page_t* page;
if (page_dir_get_n_heap(new_page) == 2) {
- page_copy_rec_list_end_to_created_page(new_page, page, rec,
+ page_copy_rec_list_end_to_created_page(new_page, rec,
index, mtr);
} else {
- page_copy_rec_list_end_no_locks(new_page, page, rec,
- index, mtr);
+ page_copy_rec_list_end_no_locks(new_page, rec, index, mtr);
}
+ page = ut_align_down(rec, UNIV_PAGE_SIZE);
+
/* Update the lock table, MAX_TRX_ID, and possible hash index */
lock_move_rec_list_end(new_page, page, rec);
@@ -568,26 +570,27 @@
page_copy_rec_list_start(
/*=====================*/
page_t* new_page, /* in: index page to copy to */
- page_t* page, /* in: index page */
rec_t* rec, /* in: record on page */
dict_index_t* index, /* in: record descriptor */
mtr_t* mtr) /* in: mtr */
{
page_cur_t cur1;
page_cur_t cur2;
+ page_t* page;
rec_t* old_end;
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
- page_cur_set_before_first(page, &cur1);
-
- if (rec == page_cur_get_rec(&cur1)) {
+ if (page_rec_is_infimum(rec)) {
return;
}
+ page = ut_align_down(rec, UNIV_PAGE_SIZE);
+
+ page_cur_set_before_first(page, &cur1);
page_cur_move_to_next(&cur1);
page_cur_set_after_last(new_page, &cur2);
@@ -687,14 +690,14 @@
return(ptr);
}
- ut_ad(!!page_is_comp(page) == index->table->comp);
+ ut_ad((ibool) !!page_is_comp(page) == index->table->comp);
if (type == MLOG_LIST_END_DELETE
|| type == MLOG_COMP_LIST_END_DELETE) {
- page_delete_rec_list_end(page, page + offset, index,
+ page_delete_rec_list_end(page + offset, index,
ULINT_UNDEFINED, ULINT_UNDEFINED, mtr);
} else {
- page_delete_rec_list_start(page, page + offset, index, mtr);
+ page_delete_rec_list_start(page + offset, index, mtr);
}
return(ptr);
@@ -707,7 +710,6 @@
void
page_delete_rec_list_end(
/*=====================*/
- page_t* page, /* in: index page */
rec_t* rec, /* in: record on page */
dict_index_t* index, /* in: record descriptor */
ulint n_recs, /* in: number of records to delete,
@@ -721,17 +723,17 @@
ulint slot_index;
rec_t* last_rec;
rec_t* prev_rec;
- rec_t* free;
rec_t* rec2;
ulint count;
ulint n_owned;
- rec_t* sup;
- ulint comp;
+ page_t* page;
/* Reset the last insert info in the page header and increment
the modify clock for the frame */
ut_ad(size == ULINT_UNDEFINED || size < UNIV_PAGE_SIZE);
+
+ page = ut_align_down(rec, UNIV_PAGE_SIZE);
page_header_set_ptr(page, PAGE_LAST_INSERT, NULL);
/* The page gets invalid for optimistic searches: increment the
@@ -739,24 +741,22 @@
buf_frame_modify_clock_inc(page);
- sup = page_get_supremum_rec(page);
-
- comp = page_is_comp(page);
- if (page_rec_is_infimum_low(rec - page)) {
+ if (page_rec_is_infimum(rec)) {
rec = page_rec_get_next(rec);
}
- page_delete_rec_list_write_log(rec, index,
- comp ? MLOG_COMP_LIST_END_DELETE : MLOG_LIST_END_DELETE, mtr);
+ page_delete_rec_list_write_log(rec, index, page_is_comp(page)
+ ? MLOG_COMP_LIST_END_DELETE
+ : MLOG_LIST_END_DELETE, mtr);
- if (rec == sup) {
+ if (page_rec_is_supremum(rec)) {
return;
}
prev_rec = page_rec_get_prev(rec);
- last_rec = page_rec_get_prev(sup);
+ last_rec = page_rec_get_prev(page_get_supremum_rec(page));
if ((size == ULINT_UNDEFINED) || (n_recs == ULINT_UNDEFINED)) {
mem_heap_t* heap = NULL;
@@ -768,7 +768,7 @@
n_recs = 0;
rec2 = rec;
- while (rec2 != sup) {
+ do {
ulint s;
offsets = rec_get_offsets(rec2, index, offsets,
ULINT_UNDEFINED, &heap);
@@ -780,7 +780,7 @@
n_recs++;
rec2 = page_rec_get_next(rec2);
- }
+ } while (!page_rec_is_supremum(rec2));
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
@@ -795,21 +795,21 @@
rec2 = rec;
count = 0;
-
- while (rec_get_n_owned(rec2, comp) == 0) {
+
+ while (rec_get_n_owned(rec2, page_is_comp(page)) == 0) {
count++;
rec2 = page_rec_get_next(rec2);
}
- ut_ad(rec_get_n_owned(rec2, comp) - count > 0);
+ ut_ad(rec_get_n_owned(rec2, page_is_comp(page)) > count);
+
+ n_owned = rec_get_n_owned(rec2, page_is_comp(page)) - count;
- n_owned = rec_get_n_owned(rec2, comp) - count;
-
slot_index = page_dir_find_owner_slot(rec2);
slot = page_dir_get_nth_slot(page, slot_index);
- page_dir_slot_set_rec(slot, sup);
+ page_dir_slot_set_rec(slot, page_get_supremum_rec(page));
page_dir_slot_set_n_owned(slot, n_owned);
page_dir_set_n_slots(page, slot_index + 1);
@@ -819,9 +819,7 @@
/* Catenate the deleted chain segment to the page free list */
- free = page_header_get_ptr(page, PAGE_FREE);
-
- page_rec_set_next(last_rec, free);
+ page_rec_set_next(last_rec, page_header_get_ptr(page, PAGE_FREE));
page_header_set_ptr(page, PAGE_FREE, rec);
page_header_set_field(page, PAGE_GARBAGE,
@@ -838,7 +836,6 @@
void
page_delete_rec_list_start(
/*=======================*/
- page_t* page, /* in: index page */
rec_t* rec, /* in: record on page */
dict_index_t* index, /* in: record descriptor */
mtr_t* mtr) /* in: mtr */
@@ -851,9 +848,9 @@
byte type;
*offsets_ = (sizeof offsets_) / sizeof *offsets_;
- ut_ad(!!page_is_comp(page) == index->table->comp);
+ ut_ad((ibool) !!page_rec_is_comp(rec) == index->table->comp);
- if (page_is_comp(page)) {
+ if (page_rec_is_comp(rec)) {
type = MLOG_COMP_LIST_START_DELETE;
} else {
type = MLOG_LIST_START_DELETE;
@@ -861,13 +858,12 @@
page_delete_rec_list_write_log(rec, index, type, mtr);
- page_cur_set_before_first(page, &cur1);
-
- if (rec == page_cur_get_rec(&cur1)) {
+ if (page_rec_is_infimum(rec)) {
return;
}
+ page_cur_set_before_first(ut_align_down(rec, UNIV_PAGE_SIZE), &cur1);
page_cur_move_to_next(&cur1);
/* Individual deletes are not logged */
@@ -897,7 +893,6 @@
page_move_rec_list_end(
/*===================*/
page_t* new_page, /* in: index page where to move */
- page_t* page, /* in: index page */
rec_t* split_rec, /* in: first record to move */
dict_index_t* index, /* in: record descriptor */
mtr_t* mtr) /* in: mtr */
@@ -910,14 +905,14 @@
old_data_size = page_get_data_size(new_page);
old_n_recs = page_get_n_recs(new_page);
- page_copy_rec_list_end(new_page, page, split_rec, index, mtr);
+ page_copy_rec_list_end(new_page, split_rec, index, mtr);
new_data_size = page_get_data_size(new_page);
new_n_recs = page_get_n_recs(new_page);
ut_ad(new_data_size >= old_data_size);
- page_delete_rec_list_end(page, split_rec, index,
+ page_delete_rec_list_end(split_rec, index,
new_n_recs - old_n_recs, new_data_size - old_data_size, mtr);
}
@@ -929,14 +924,13 @@
page_move_rec_list_start(
/*=====================*/
page_t* new_page, /* in: index page where to move */
- page_t* page, /* in: index page */
rec_t* split_rec, /* in: first record not to move */
dict_index_t* index, /* in: record descriptor */
mtr_t* mtr) /* in: mtr */
{
- page_copy_rec_list_start(new_page, page, split_rec, index, mtr);
+ page_copy_rec_list_start(new_page, split_rec, index, mtr);
- page_delete_rec_list_start(page, split_rec, index, mtr);
+ page_delete_rec_list_start(split_rec, index, mtr);
}
/***************************************************************************
--- 1.94/innobase/row/row0sel.c 2005-07-02 00:39:22 +03:00
+++ 1.95/innobase/row/row0sel.c 2005-07-11 13:50:16 +03:00
@@ -2059,7 +2059,7 @@
dfield = dtuple_get_nth_field(tuple, 0);
field = dict_index_get_nth_field(index, 0);
- if (dfield_get_type(dfield)->mtype == DATA_SYS) {
+ if (UNIV_UNLIKELY(dfield_get_type(dfield)->mtype == DATA_SYS)) {
/* A special case: we are looking for a position in the
generated clustered index which InnoDB automatically added
to a table with no primary key: the first and the only
@@ -2077,8 +2077,9 @@
while (key_ptr < key_end) {
- ut_a(dict_col_get_type(field->col)->mtype
- == dfield_get_type(dfield)->mtype);
+ type = dfield_get_type(dfield)->mtype;
+
+ ut_a(dict_col_get_type(field->col)->mtype == type);
data_offset = 0;
is_null = FALSE;
@@ -2096,8 +2097,6 @@
}
}
- type = dfield_get_type(dfield)->mtype;
-
/* Calculate data length and data field total length */
if (type == DATA_BLOB) {
@@ -2143,9 +2142,9 @@
data_field_len = data_offset + data_len;
}
- if (dtype_get_mysql_type(dfield_get_type(dfield))
- == DATA_MYSQL_TRUE_VARCHAR
- && dfield_get_type(dfield)->mtype != DATA_INT) {
+ if (UNIV_UNLIKELY(dtype_get_mysql_type(dfield_get_type(dfield))
+ == DATA_MYSQL_TRUE_VARCHAR)
+ && UNIV_LIKELY(type != DATA_INT)) {
/* In a MySQL key value format, a true VARCHAR is
always preceded by 2 bytes of a length field.
dfield_get_type(dfield)->len returns the maximum
@@ -2161,7 +2160,7 @@
/* Storing may use at most data_len bytes of buf */
- if (!is_null) {
+ if (UNIV_LIKELY(!is_null)) {
row_mysql_store_col_in_innobase_format(
dfield,
buf,
@@ -2174,7 +2173,7 @@
key_ptr += data_field_len;
- if (key_ptr > key_end) {
+ if (UNIV_UNLIKELY(key_ptr > key_end)) {
/* The last field in key was not a complete key field
but a prefix of it.
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 6
- Accessing original query from within storage engine
Hi,
Is there a reliable way to inspect the original SQL statement (or
corresponding parse tree) that caused a particular storage engine operation
to occur? Within a number of handler methods, I can get to either
thd->Statement or this->table->in_use->Statement. However, inside
create_table() and delete_table(), I don't have thd and this->table appears
to be unititialized or already destroyed, respectively.
The specific problem I'm trying to solve is to find out whether RESTRICT or
CASCADE were specified on a DROP TABLE. I realize that MySQL ignores these
keywords, but I would like my storage engine to possibly perform special
processing if they are specified.
Thank you,
Tim Clark
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 7
- funny error during cpan install of dbd::mysql - help please--0-1063252698-1073258122=:18020
Content-Type: text/plain; charset=us-ascii
I am on suse 9.0, perl 5.8
using cpan perl module (perl -MCPAN -e shell)
and install DBD::mysql I obtained the following error:
"/usr/lib/gcc-lib/i5860suse-linux/3.3.1/../../../bin/ld: cannot find -lz
collect2: ld returned 1 exist status
An error occurred while linking the DBD::mysql driver. The error message seems to indicate that you dont have a libz.a or a libza.so"
Can anybody suggest a possible fix?
Thanks in advance!!
---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
--0-1063252698-1073258122=:18020--
- 8
- nested set: algorithm for testing the integrityI'm looking for a algorithm which checks if a nested set with many
nodes and levels is correct.
I know the pear class and I have read a few tutorials, maybe there is
a mathematical solution for this test?
thx.
- 9
- mysqldump not including auto_increment statementsHello all --
I'm using mysqldump to dump an innodb database. I've looked at the
resulting output file, and the CREATE TABLE statements do not include
the auto_increment for the fields I've specified.
CREATE TABLE `CardQuestions` (
`id` int(10) unsigned NOT NULL,
...
However, phpMyAdmin creates a table the way I already specified with
its export command:
CREATE TABLE IF NOT EXISTS `CardQuestions` (
`id` int(10) unsigned NOT NULL auto_increment,
...
I've read over the mysqldump man page, and it doesn't say anything
about switches for including auto_increment statements. Similar google
searches have turned up nothing about my problem. What's going on?
- 10
- Odd/Even AutoincrementsRevisiting the issue of high availability.
I know that you can have dual masters; each replication each other. You
just have to make sure that with your primary keys there aren't any
conflicts.
With two masters and systems that utilize an autoincrement for their
primary key, if you could ensure that one system autoincrements only even
numbers, and the other system with odd numbers, if either one ever went
down, when the system came back up, they should be able to resync without
any conflicts.
Does anyone utilize something like this above?
- 11
- mysql startup script problemHello all -
I'm having a small problem with the mysql startup script that ships with
MySQL-3.23.56-1.
I'm running on RedHat Linux.
It works fine, but I have a backup server that runs a script that passes
these commands remotely through ssh:
(1) ssh dbsys-dc "sudo /etc/init.d/mysql stop" (2) ssh dbsys-dc "sudo tar
czpf - /var" > dbsys-dc.var.$(date -I).tgz (3) ssh dbsys-dc "sudo tar czpf
- /db" > dbsys-dc.db.$(date -I).tgz (4) ssh dbsys-dc "sudo
/etc/init.d/mysql start"
Essentially, what I'm doing is stopping the mysql server, then backing up
the directories, the starting the server again.
The problem is that I have additional commands in my backup script
following line 4 above (backup additional filesystems and server, then
write all the tarballs to tape), but the mysql start script does not exit
properly after starting the mysql server, and I come in the next morning
and find that my backup script is stuck on line 4 above, so the rest of my
filesystems and servers never get backed up, nor get written to tape.
If I do a "ps aux" and find the PID for that task and kill it, then the
rest of my script will proceed.
"mysql stop" seems to exit fine -- it's just "mysql start" that seems to
keep the shell locked.
Does anybody know how to fix this or a workaround?
Thanks so much.
Duane Winner
email***@***.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=email***@***.com
- 12
- bk commit into 4.1 tree (monty:1.2186)Below is the list of changes that have just been committed into a local
4.1 repository of monty. When monty 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
ChangeSet
1.2186 05/02/22 15:08:12 email***@***.com +1 -0
Fix errors in my last changeset
libmysql/libmysql.c
1.290 05/02/22 15:08:06 email***@***.com +5 -2
Fix errors in my last changeset
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: monty
# Host: narttu.mysql.com
# Root: /home/my/mysql-4.1
--- 1.289/libmysql/libmysql.c 2005-02-10 17:24:15 +02:00
+++ 1.290/libmysql/libmysql.c 2005-02-22 15:08:06 +02:00
@@ -3390,14 +3390,17 @@
}
case MYSQL_TYPE_FLOAT:
{
+ char *end_not_used;
float data = (float) my_strntod(&my_charset_latin1, value, length,
- NULL, &err);
+ &end_not_used, &err);
floatstore(buffer, data);
break;
}
case MYSQL_TYPE_DOUBLE:
{
- double data= my_strntod(&my_charset_latin1, value, length, NULL, &err);
+ char *end_not_used;
+ double data= my_strntod(&my_charset_latin1, value, length, &end_not_used,
+ &err);
doublestore(buffer, data);
break;
}
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?unsub=email***@***.com
- 13
- Mysql Crashes I/O error...Hello everybody,
I am looking for some help on my mysql server crashes.
I run version 5.0.27 on Fedora 6.
However, suddenly mysql server starting crashing. I revised the log
and it is telling me that is having a input/output operating system
error on a read operation.
The error shows up like this on the log:
070803 00:29:12 mysqld started
070803 0:29:12 InnoDB: Started; log sequence number 0 210331564
070803 0:29:12 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.0.27' socket: '/var/lib/mysql/mysql.sock' port: 3306
Source distribution
InnoDB: Error: tried to read 16384 bytes at offset 0 29802496.
InnoDB: Was only able to read -1.
070803 0:29:43 InnoDB: Operating system error number 5 in a file operation.
InnoDB: Error number 5 means 'Input/output error'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/operating-system-error-codes.html
InnoDB: File operation call: 'read'.
InnoDB: Cannot continue operation.
I check my disk with smartd utility and it passes the test.
I do not know where to look. Any help will be greatly appreciated.
George Crewe
- 14
- Find result that matches ALL values in array?Using an IN query, I am able to pass something like this to my
database to get the values that match at least one of the array
values.
SELECT * FROM contacts WHERE (work_lat != '' and work_long != '' and
id in (select tutor_id from subjects_tutors where subject_id in
(17,18,22,26,27,35))) AND ( (contacts.`type` = 'Tutor' ) )
What I need to do is have the query search for results that match all
array values. In other words, in the example above I need a tutor who
matches subject_id 17,18,22,26,27 and 35. The data model is for a
Ruby on Rails application I am developing for a client.
Any help would be appreciated.
Thank you!
-
Justin Williams
Owner, Second Gear
http://secondgearllc.com/
-
Check out Porchlight: bug tracking for small teams <http://
www.porchlightnow.com>
- 15
- windows aio errorPlease help with the following issue.
I am trying to dump a table. My mysqldump command is:
mysqldump.exe -u xx -P xx --add-drop-table --quick --extended-insert
--result-file=xx "--where=cdrdate > CURDATE() - INTERVAL 1 MONTH" mydb
calldetailrecords
It consistenly crashes the database with the error (as seen in the
error log):
040909 8:16:17 InnoDB: Operating system error number 995 in a file
operation.
InnoDB: See section 13.2 at http://www.innodb.com/ibman.php
InnoDB: about operating system error numbers.
InnoDB: File name d:\mysql-4.1.4\data\ibdata1
InnoDB: File operation call: 'Windows aio'.
InnoDB: Cannot continue operation.
This first occured with mysql 4.0.16 on WinXP. I upgraded to 4.1.4
thinking it would solve the problem (see
http://dev.mysql.com/doc/mysql/en/InnoDB_news-4.1.4.html where it
discusses the previous problems with IO and Innodb). The upgrade
didn't help - the same exact error and crashing occurs.
I tried to dump a different table and still received the same error.
Please email me at email***@***.com.
Thanks.
dan k.
|
|
|