Database Administrators
Q&A for database professionals who wish to improve their database skills
Latest Questions
1
votes
0
answers
15
views
mysql build error on Raspberry Pi Model 3A+ with Raspbian
I am building MySQL version 8.0.37 on a Raspberry Pi Model 3A+ with the Raspbian OS. I have encountered several build errors regarding missing dependancies and resolved them. I am now faced with an error I am not sure how to debug. Can anyone provide any insight ? The error is: ``` In file included...
I am building MySQL version 8.0.37 on a Raspberry Pi Model 3A+ with the Raspbian OS.
I have encountered several build errors regarding missing dependancies and resolved them. I am now faced with an error I am not sure how to debug. Can anyone provide any insight ?
The error is:
In file included from /srv/mysql-8.0.37/storage/innobase/include/log0recv.h:40,
from /srv/mysql-8.0.37/storage/innobase/include/fil0fil.h:41,
from /srv/mysql-8.0.37/storage/innobase/include/buf0buf.h:38,
from /srv/mysql-8.0.37/storage/innobase/buf/checksum.cc:37:
/srv/mysql-8.0.37/storage/innobase/include/log0sys.h:202:60: error: static assertion failed
202 | static_assert(decltype(write_to_file_requests_interval)::is_always_lock_free);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /srv/mysql-8.0.37/storage/innobase/buf/checksum.cc:37:
/srv/mysql-8.0.37/storage/innobase/include/buf0buf.h:1742:42: error: static assertion failed
1742 | static_assert(decltype(prefix_info)::is_always_lock_free);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /srv/mysql-8.0.37/storage/innobase/include/log0recv.h:40,
from /srv/mysql-8.0.37/storage/innobase/include/fil0fil.h:41,
from /srv/mysql-8.0.37/storage/innobase/include/buf0buf.h:38,
from /srv/mysql-8.0.37/storage/innobase/include/dict0mem.h:63,
from /srv/mysql-8.0.37/storage/innobase/include/dict0dict.h:45,
from /srv/mysql-8.0.37/storage/innobase/dict/dict.cc:41:
/srv/mysql-8.0.37/storage/innobase/include/log0sys.h:202:60: error: static assertion failed
202 | static_assert(decltype(write_to_file_requests_interval)::is_always_lock_free);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /srv/mysql-8.0.37/storage/innobase/include/dict0mem.h:63,
from /srv/mysql-8.0.37/storage/innobase/include/dict0dict.h:45,
from /srv/mysql-8.0.37/storage/innobase/dict/dict.cc:41:
/srv/mysql-8.0.37/storage/innobase/include/buf0buf.h:1742:42: error: static assertion failed
1742 | static_assert(decltype(prefix_info)::is_always_lock_free);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /srv/mysql-8.0.37/storage/innobase/include/dict0dict.h:45,
from /srv/mysql-8.0.37/storage/innobase/dict/dict.cc:41:
/srv/mysql-8.0.37/storage/innobase/include/dict0mem.h:2412:40: error: static assertion failed
2412 | static_assert(decltype(update_time)::is_always_lock_free);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
make: *** [storage/innobase/CMakeFiles/innodb_zipdecompress.dir/build.make:95: storage/innobase/CMakeFiles/innodb_zipdecompress.dir/buf/checksum.cc.o] Error 1
This doesn't look like a dependancy issue, but aside from that, I'm not sure how to interpret the error.
Background info
---------------
Raspbian is a fork of Debian, currently version 'bookworm'. The Raspbian Pi 3A+ has an ARMv8 processor with a 64-bit timer.
user10709800
(21 rep)
Jun 15, 2024, 06:47 PM
1
votes
0
answers
53
views
How would I skip test compilation in a MySQL build?
As the title suggests, I am building MySQL version 8.0.37 from source on a Linux machine and would like to skip test compilation. I have attempted adding the flag: ``` -DINSTALL_MYSQLTESTDIR= ``` which, according to https://dev.mysql.com/doc/refman/8.0/en/source-configuration-options.html#option_cma...
As the title suggests, I am building MySQL version 8.0.37 from source on a Linux machine and would like to skip test compilation.
I have attempted adding the flag:
-DINSTALL_MYSQLTESTDIR=
which, according to https://dev.mysql.com/doc/refman/8.0/en/source-configuration-options.html#option_cmake_install_mysqltestdir , should '... suppress installation of this directory.' The directory is still being installed.
Could it be a position dependent flag? The only flags prior to this in my call to cmake
are -DDOWNLOAD_BOOST=1
and -DWITH_BOOST=/path/to/boost/
.
How does one avoid building the test files ? I have not been able to find explanations online.
I am building on the Raspbian OS, which is a fork of Debian 'Bookworm'.
user10709800
(21 rep)
Jun 15, 2024, 03:59 PM
1
votes
2
answers
3673
views
Is there a way to examine SQL Jobs for references to linked servers?
In preparation for migrating a server farm to the cloud, I am attempting to enumerate all the linked servers that have been defined over the years. I also need to find (and correct) the code that references these linked servers. Here is something I threw togetether to help identify names of objects...
In preparation for migrating a server farm to the cloud, I am attempting to enumerate all the linked servers that have been defined over the years. I also need to find (and correct) the code that references these linked servers.
Here is something I threw togetether to help identify names of objects that refer to the linked server, but this only works against stored procs, views, functions and triggers:
declare @sql varchar(2000)
select @SQL = 'use ?;
print ''?'';
print replicate(''-'',len(''?''));
print '' '';
select object_name(sc.id)
from syscomments sc
where text like ''%TheLinkedServer%''
'
exec sp_msforeachdb @sql
I know I will have to crack open the DTS/SSIS packages...I am just trying to get as many finished as quickly as possible.
datagod
(7141 rep)
Sep 26, 2012, 06:20 PM
• Last activity: May 8, 2020, 04:18 AM
1
votes
1
answers
1000
views
Source code of View of Linked server sp_HelpText
How to use sp_helptext for view on the linked server ?
How to use sp_helptext for view on the linked server ?
Adam
(21 rep)
Jan 3, 2018, 08:12 AM
• Last activity: Jan 3, 2018, 08:19 AM
2
votes
1
answers
165
views
PostGIS error building with `make` in ./extensions: nothing to be done for 'comments'
I'm using code I checked out from SVN. Whenever I run `make` in `./extensions/`, I get make for DIR in postgis postgis_tiger_geocoder postgis_topology address_standardizer; do \ echo "---- Making all in ${DIR}"; \ make -C "${DIR}" all || exit 1; \ done ---- Making all in postgis make[1]: Entering di...
I'm using code I checked out from SVN. Whenever I run
make
in ./extensions/
, I get
make
for DIR in postgis postgis_tiger_geocoder postgis_topology address_standardizer; do \
echo "---- Making all in ${DIR}"; \
make -C "${DIR}" all || exit 1; \
done
---- Making all in postgis
make: Entering directory '/home/ecarroll/code/postgis/extensions/postgis'
mkdir -p sql_bits/
/usr/bin/perl -pe 's/BEGIN\;//g ; s/COMMIT\;//g' ../../postgis/postgis_for_extension.sql > sql_bits/postgis.sql
make -C ../../doc comments
make: Entering directory '/home/ecarroll/code/postgis/doc'
make: Nothing to be done for 'comments'.
make: Leaving directory '/home/ecarroll/code/postgis/doc'
cp ../../doc/postgis_comments.sql sql_bits/postgis_comments.sql
cp: cannot stat '../../doc/postgis_comments.sql': No such file or directory
Makefile:72: recipe for target 'sql_bits/postgis_comments.sql' failed
make: *** [sql_bits/postgis_comments.sql] Error 1
make: Leaving directory '/home/ecarroll/code/postgis/extensions/postgis'
Makefile:26: recipe for target 'all' failed
Whenever I run make comments
in the root I get a small portion of those errors,
make comments
make -C doc comments
make: Entering directory '/home/ecarroll/code/postgis/doc'
make: Nothing to be done for 'comments'.
make: Leaving directory '/home/ecarroll/code/postgis/doc'
How do I resolve this?
Evan Carroll
(65502 rep)
Nov 10, 2016, 10:13 PM
• Last activity: Nov 11, 2016, 03:06 AM
1
votes
1
answers
301
views
PostGIS error building with `make` in ./extensions: make[1]: *** No rule to make target
Whenever I run `make` in extensions, I'm getting error. make for DIR in postgis postgis_tiger_geocoder postgis_topology address_standardizer; do \ echo "---- Making all in ${DIR}"; \ make -C "${DIR}" all || exit 1; \ done ---- Making all in postgis make[1]: Entering directory '/home/ecarroll/code/po...
Whenever I run
make
in extensions, I'm getting error.
make
for DIR in postgis postgis_tiger_geocoder postgis_topology address_standardizer; do \
echo "---- Making all in ${DIR}"; \
make -C "${DIR}" all || exit 1; \
done
---- Making all in postgis
make: Entering directory '/home/ecarroll/code/postgis/extensions/postgis'
cp ../../doc/postgis_comments.sql sql_bits/postgis_comments.sql
make: *** No rule to make target '../../raster/rt_pg/rtpostgis_for_extension.sql', needed by 'sql_bits/rtpostgis.sql'. Stop.
make: Leaving directory '/home/ecarroll/code/postgis/extensions/postgis'
Makefile:26: recipe for target 'all' failed
make: *** [all] Error 1
Evan Carroll
(65502 rep)
Nov 10, 2016, 10:32 PM
0
votes
0
answers
95
views
How to selecting data from two queries using union?
I have three tables. I am trying to taking the data with two times interval after then subtracting from first two second for every possible row and getting the ledger report. Solution is given by: **jkavalik** [Solved MySql Fiddle][1] My Problem [MYSQL FIDDLE][2] My simple query run and gives me som...
I have three tables. I am trying to taking the data with two times interval after then subtracting from first two second for every possible row and getting the ledger report.
Solution is given by: **jkavalik**
Solved MySql Fiddle
My Problem
MYSQL FIDDLE
My simple query run and gives me some data:
SELECT lh.group_id,lh.opening_balance,lh.ledger_head_id,sum(dc.debit)
AS sum_dr,sum(dc.credit) AS sum_cr FROM ac_debit_credit dc
INNER JOIN ac_transaction_master tm ON tm.tran_id=dc.tran_id
INNER JOIN ac_ledger_head lh ON lh.ledger_head_id=dc.ledger_head_id
WHERE (tm.transaction_date BETWEEN '2015/09/01' AND '2015/10/10') AND lh.group_id IN('8', '9', '56', '10', '11', '12', '13',
'14') group by dc.ledger_head_id
UNION
SELECT lh.group_id,lh.opening_balance,lh.ledger_head_id,sum(dc.debit) AS sum_dr2,sum(dc.credit) AS sum_cr2 FROM ac_debit_credit dc
INNER JOIN ac_transaction_master tm ON tm.tran_id=dc.tran_id
INNER JOIN ac_ledger_head lh ON lh.ledger_head_id=dc.ledger_head_id
WHERE (tm.transaction_date<'2015/09/01') AND lh.group_id IN('8', '9', '56', '10', '11', '12', '13',
'14') group by dc.ledger_head_id
But I need to execute this:
SELECT PF.opening_balance,PF.sum_dr,PF.sum_cr,PF.sum_dr2,PF.sum_cr2,(PF.sum_dr-PF.sum_cr) as cv,(PF.sum_dr2-PF.sum_cr2) as cv2 FROM (
SELECT PR.* FROM(
SELECT lh.group_id,lh.opening_balance,lh.ledger_head_id,sum(dc.debit) AS sum_dr,sum(dc.credit) AS sum_cr FROM ac_debit_credit dc
INNER JOIN ac_transaction_master tm ON tm.tran_id=dc.tran_id
INNER JOIN ac_ledger_head lh ON lh.ledger_head_id=dc.ledger_head_id
WHERE (tm.transaction_date BETWEEN '2015/09/01' AND '2015/10/10') AND lh.group_id IN('8', '9', '56', '10', '11', '12', '13',
'14') group by dc.ledger_head_id
) AS PR
UNION
SELECT PV.* FROM(
SELECT lh.group_id,lh.opening_balance,lh.ledger_head_id,sum(dc.debit)
AS sum_dr2,sum(dc.credit) AS sum_cr2 FROM ac_debit_credit dc
INNER JOIN ac_transaction_master tm ON tm.tran_id=dc.tran_id
INNER JOIN ac_ledger_head lh ON lh.ledger_head_id=dc.ledger_head_id
WHERE (tm.transaction_date<'2015/09/01') AND lh.group_id IN('8', '9', '56', '10', '11', '12', '13',
'14') group by dc.ledger_head_id
) AS PV GROUP BY ledger_head_id
) AS PF;
Where am I wrong in my second query ?
Kabir Hossain
(103 rep)
Oct 12, 2015, 05:43 PM
• Last activity: Oct 13, 2015, 05:51 AM
1
votes
0
answers
478
views
SQLite insertion with junction table
I need to write a transaction for SQLite, that adds a blog post and links it to content tags, and it seems to be a bit too complicated for me. Here's an example schema: CREATE TABLE blogpost( id INTEGER PRIMARY KEY, content TEXT ); CREATE TABLE blogpost_tag( blogpost_id INTEGER NOT NULL, tag_id INTE...
I need to write a transaction for SQLite, that adds a blog post and links it to content tags, and it seems to be a bit too complicated for me. Here's an example schema:
CREATE TABLE blogpost(
id INTEGER PRIMARY KEY,
content TEXT
);
CREATE TABLE blogpost_tag(
blogpost_id INTEGER NOT NULL,
tag_id INTEGER NOT NULL,
PRIMARY KEY (blogpost_id, tag_id),
FOREIGN KEY (blogpost_id) REFERENCES blogpost(id),
FOREIGN KEY (tag_id) REFERENCES tag(id) ON DELETE CASCADE
);
CREATE TABLE tag(
id INTEGER PRIMARY KEY,
name TEXT
);
I have the blog post content string and two tag strings, and now I need to write these into the database in an atomic transaction.
* The blog post content row need to be inserted into blogpost table.
* Let's assume that one of the tags already exists in tag table. Other one is new and needs to be inserted.
* Blogposts and tags have a many-to-many relationship, so I need to insert two rows to blogpost_tag table.
How do I write this transaction?
dba9999
(11 rep)
Apr 10, 2015, 01:29 PM
• Last activity: Jun 21, 2015, 02:35 PM
0
votes
1
answers
265
views
Can't find source code for building mysql
I'm trying to follow the [instructions](http://dev.mysql.com/doc/refman/5.6/en/source-installation.html) for building MySQL from source. They guide me to a [link](http://dev.mysql.com/doc/refman/5.6/en/getting-mysql.html) where I can download the latest GA. I end up at the downloads [page](http://de...
I'm trying to follow the [instructions](http://dev.mysql.com/doc/refman/5.6/en/source-installation.html) for building MySQL from source. They guide me to a [link](http://dev.mysql.com/doc/refman/5.6/en/getting-mysql.html) where I can download the latest GA. I end up at the downloads [page](http://dev.mysql.com/downloads/mysql/) , where I can download
mysql-5.6.19-osx10.7-x86_64.tar.gz
for my mac, and then untar and unzip.
All good so far. But when I try to cmake .
per the instructions, I get an error saying that it can't find CMakeLists.txt
. Poking around looking for that, I've discovered that the download doesn't come with any actual source code except .h
files. In fact, the download looks like an already-built setup with binaries such as mysqld
already there.
I am probably missing something obvious, but I can't figure out where I'm supposed to get the full source code and the makefile, if not from the links provided under the title, "Installing MySQL Using a Standard Source Distribution". Anyone have an idea?
SaganRitual
(109 rep)
Jul 13, 2014, 09:02 PM
• Last activity: Sep 18, 2014, 08:26 AM
1
votes
1
answers
227
views
Implementing a simple ERD in MySQL: is the implementation below 100% compliant with the ERD?
**ERD** Consider the following ERD: ![enter image description here][1] ---------- **Tables** From it, I derived the following tables: Company ------------------ c_id c_name ------------------ CompanyEmail ------------------ c_id e_id ------------------ Email ------------------ e_id e_addr ----------...
**ERD**
Consider the following ERD:
----------
**Tables**
From it, I derived the following tables:
Company
------------------
c_id c_name
------------------
CompanyEmail
------------------
c_id e_id
------------------
Email
------------------
e_id e_addr
------------------
Note: the use of the relationship table (

CompanyEmail
) is [not arbitrary](https://dba.stackexchange.com/questions/63790/conversion-of-simple-erd-to-table-is-the-solution-below-any-good) .
----------
**Implementation**
From those tables, I made the following implementation (tested in MySQL Workbench 6.1):
- http://pastebin.com/3A0H21kw (please bear with my lack of skills :)
I guess the most important part of it (besides learning the language) was deciding which attribute is FK and the use of CASCADE
. Is it [CASCADE
] the implementation of parcial/strong participation? and/or weak/strong entity?
----------
Question
----------
- Does my implementation accurately complies with the ERD? If not, what would be a better solution?
feelthhis
(265 rep)
May 9, 2014, 07:34 AM
• Last activity: May 13, 2014, 01:19 PM
6
votes
1
answers
33853
views
Show procedure code in MySQL
I've tried to show the SQL code of a stored procedure called `add_pixel`: mysql> SHOW PROCEDURE CODE add_pixel; ERROR 1064 (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 I've made sure that t...
I've tried to show the SQL code of a stored procedure called
add_pixel
:
mysql> SHOW PROCEDURE CODE add_pixel;
ERROR 1064 (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
I've made sure that the procedure exists:
mysql> CALL add_pixel();
ERROR 1318 (42000): Incorrect number of arguments for PROCEDURE pixels.add_pixel; expected 3, got 0
And SHOW CREATE PROCEDURE
works:
mysql> SHOW CREATE PROCEDURE add_pixel;
+-----------+----------+------------------+----------------------+----------------------+--------------------+
| Procedure | sql_mode | Create Procedure | character_set_client | collation_connection | Database Collation |
+-----------+----------+------------------+----------------------+----------------------+--------------------+
| add_pixel | | NULL | utf8 | utf8_general_ci | utf8_unicode_ci |
+-----------+----------+------------------+----------------------+----------------------+--------------------+
1 row in set (0.00 sec)
and that my MySQL version supports `SHOW PROCEDURE (SHOW PROCEDURE CODE was added in MySQL 5.0.17 ).
How do I view the source SQL code of the procedure?
Adam Matan
(12079 rep)
Aug 21, 2012, 09:24 AM
• Last activity: Aug 21, 2012, 01:48 PM
Showing page 1 of 11 total questions